cmdr
Check-in [af44ad2581]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added tests checking runtime handling of negative aliases.
Timelines: family | ancestors | descendants | both | neg-aliases
Files: files | file ages | folders
SHA1: af44ad25816b4b8196e2d9b66effe539b30b066c
User & Date: aku 2015-05-12 21:53:51
Context
2015-05-12
22:02
Added docs for negative aliases. Closed-Leaf check-in: 21b94c7e50 user: aku tags: neg-aliases
21:53
Added tests checking runtime handling of negative aliases. check-in: af44ad2581 user: aku tags: neg-aliases
2015-05-11
23:02
Update expected test results. check-in: 5299cd1353 user: aku tags: neg-aliases
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tests/runtime.tests.

   618    618   test cmdr-runtime-7.2 {validation errors} -body {
   619    619       ParseFailParse {
   620    620   	input A - { validate integer }
   621    621   	input B - { validate integer }
   622    622       } 1 X
   623    623   } -returnCodes error \
   624    624       -result {Expected an integer for input "B", got "X"}
          625  +
          626  +# # ## ### ##### ######## ############# #####################
          627  +## Options, negative aliases
          628  +
          629  +test cmdr-runtime-8.0 {options, simple, boolean, special forms II} -body {
          630  +    Parse {
          631  +	option A -
          632  +	option B -
          633  +	option C -
          634  +	option D -
          635  +	option E -
          636  +	option F -
          637  +	option G - { validate identity }
          638  +    } -A -G=X --no-B -G=X -C=1 -D=0 --no-E=1 --no-F=0
          639  +} -result {
          640  +    A = 'yes' v'1'
          641  +    B = '0'   v'0'
          642  +    C = '1'   v'1'
          643  +    D = '0'   v'0'
          644  +    E = '0'   v'0'
          645  +    F = '1'   v'1'
          646  +    G = 'X'   v'X'
          647  +}
          648  +
          649  +test cmdr-runtime-8.1 {options, boolean, aliases} -body {
          650  +    Parse {
          651  +	option A - { alias     X }
          652  +	option B - { neg-alias Y }
          653  +    } -X -Y
          654  +} -result {
          655  +    A = 'yes' v'1'
          656  +    B = '0'   v'0'
          657  +}
          658  +
          659  +test cmdr-runtime-8.2 {options, boolean, aliases, special forms} -body {
          660  +    Parse {
          661  +	option A - { alias     X }
          662  +	option B - { neg-alias Y }
          663  +    } -X=0 -Y=0
          664  +} -result {
          665  +    A = '0' v'0'
          666  +    B = '1' v'1'
          667  +}
   625    668   
   626    669   # # ## ### ##### ######## ############# #####################
   627    670   
   628    671   return