Branch: Tag:

2009-07-02

2009-07-02 18:30:02 by Martin Stjernholm <mast@lysator.liu.se>

Added tests for optional and required args of different types.

Rev: server/etc/test/tests/rxml/RoxenTest_BaseRXML.xml:1.96
Rev: server/modules/configuration/roxen_test.pike:1.78

3959:    2: ba<br/>    </result>   </test> +  +  + <!-- ............................................................ --> + <comment>Attribute tests</comment> +  + <test> +  <rxml type="any"> +  <test-args req-string="x" req-int="1" +  opt-string="&var.x;" opt-int="&var.x;" opt-float="&var.x;"/> +  </rxml> +  <equal>([ +  "req-string": "x", +  "req-int": 1, +  "opt-string": "", +  ])</equal> + </test> +  + <test> +  <rxml type="any"> +  <set variable="var.args" type="text/*"> +  req-string="x" req-int="1" +  opt-string="&var.x;" opt-int="&var.x;" opt-float="&var.x;" +  </set> +  <test-args ::="&var.args;"/> +  </rxml> +  <equal>([ +  "req-string": "x", +  "req-int": 1, +  "opt-string": "", +  ])</equal> + </test> +  + <test> +  <rxml type="any"> +  <test-args req-string="x" req-int="1" +  opt-string="" opt-int="" opt-float=""/> +  </rxml> +  <equal>([ +  "req-string": "x", +  "req-int": 1, +  "opt-string": "", +  ])</equal> + </test> +  + <test> +  <rxml type="any"> +  <set variable="var.args" type="text/*"> +  req-string="x" req-int="1" +  opt-string="" opt-int="" opt-float="" +  </set> +  <test-args ::="&var.args;"/> +  </rxml> +  <equal>([ +  "req-string": "x", +  "req-int": 1, +  "opt-string": "", +  ])</equal> + </test> +  + <test> +  <rxml> +  <test-args req-string="" req-int=""/> +  </rxml> +  <glob>[Error (parse): No value given for nonsequential type int*]</glob> + </test> +  + <test> +  <rxml> +  <set variable="var.args" type="text/*"> +  req-string="" req-int="" +  </set> +  <test-args ::="&var.args;"/> +  </rxml> +  <glob>[Error (parse): No value given for nonsequential type int*]</glob> + </test>