Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Updated the testsuite to account for the auto-help command introduced with [63db617e97]. |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
56a8582121b58a7bd7d0e5d216abd286 |
User & Date: | aku 2013-03-23 18:04:09.529 |
Context
2013-03-25
| ||
22:24 | Moved generate and default after user interaction in priority for delivering a parameter value. Fixed command scoping issues for ::list. check-in: 220effd9f1 user: andreask tags: trunk | |
2013-03-23
| ||
18:04 | Updated the testsuite to account for the auto-help command introduced with [63db617e97]. check-in: 56a8582121 user: aku tags: trunk | |
2013-03-22
| ||
22:18 | Store unmodified command into the data store, at the place where enters, for use by interposed error handlers. The repls are not aware of it yet. check-in: 4a9225da60 user: andreask tags: trunk | |
Changes
Changes to tests/support.tcl.
︙ | ︙ | |||
160 161 162 163 164 165 166 167 168 169 170 171 172 173 | # Delegates II. Full dump of the subordinates. set tmp {} foreach c [$o children] { lappend tmp [list $c [$c name]] } foreach item [lsort -dict -index 1 $tmp] { lassign $item c _ lappend result {*}[DumpOfficer $c] } return $result } # Dumping the state of a private and its parameters. proc DumpPrivate {o} { | > | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | # Delegates II. Full dump of the subordinates. set tmp {} foreach c [$o children] { lappend tmp [list $c [$c name]] } foreach item [lsort -dict -index 1 $tmp] { lassign $item c _ if {[info object class $c] eq "::xo::private"} continue lappend result {*}[DumpOfficer $c] } return $result } # Dumping the state of a private and its parameters. proc DumpPrivate {o} { |
︙ | ︙ |
Changes to tests/xo.test.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # -*- tcl -*- tcl.tk//DSL tcltest//EN//2.0 # # ## ### ##### ######## ############# ##################### ## xo.test: tests for the xo package kt check Tcl 8.5 kt check tcltest 2 kt require support TclOO kt require support oo::util 1.2 kt require support struct::queue kt require support try kt require support string::token::shell kt require support textutil::adjust kt local support xo::util kt local support xo::help kt local support xo::parameter | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # -*- tcl -*- tcl.tk//DSL tcltest//EN//2.0 # # ## ### ##### ######## ############# ##################### ## xo.test: tests for the xo package kt check Tcl 8.5 kt check tcltest 2 kt require support TclOO kt require support oo::util 1.2 kt require support struct::queue kt require support try kt require support lambda kt require support string::token::shell kt require support textutil::adjust kt local support xo::util kt local support xo::help kt local support xo::parameter |
︙ | ︙ |
Changes to tests/xo_help.tests.
︙ | ︙ | |||
38 39 40 41 42 43 44 | undocumented private cloak {} ::dagger } } x help } -cleanup { x destroy | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > > > > > > > > > > | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > | > > | > > | > > | > | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 | undocumented private cloak {} ::dagger } } x help } -cleanup { x destroy } -result {{bar aloha} {desc hawaii options {--lulu loop --no-lulu {Complementary alias of --lulu.}} arguments {yoyo {code + desc height} jump {code ? desc gate} run {code +* desc lane}}} {bar help} {desc {Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full.} options {--short { Activate short form of the help. } --list { Activate list form of the help. } --full { Activate full form of the help. }} arguments {cmdname {code ?* desc { The entire command line, the name of the command to get help for. This can be several words. }}}} {snafu aloha} {desc hawaii options {--lulu loop --no-lulu {Complementary alias of --lulu.}} arguments {yoyo {code + desc height} jump {code ? desc gate} run {code +* desc lane}}} {snafu help} {desc {Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full.} options {--short { Activate short form of the help. } --list { Activate list form of the help. } --full { Activate full form of the help. }} arguments {cmdname {code ?* desc { The entire command line, the name of the command to get help for. This can be several words. }}}} {tool pliers help} {desc {Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full.} options {--short { Activate short form of the help. } --list { Activate list form of the help. } --full { Activate full form of the help. }} arguments {cmdname {code ?* desc { The entire command line, the name of the command to get help for. This can be several words. }}}} {tool hammer nail} {desc workbench options {--driver force --force {Alias of --driver.}} arguments {supply {code ?* desc magazine}}} {tool hammer help} {desc {Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full.} options {--short { Activate short form of the help. } --list { Activate list form of the help. } --full { Activate full form of the help. }} arguments {cmdname {code ?* desc { The entire command line, the name of the command to get help for. This can be several words. }}}} {tool help} {desc {Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full.} options {--short { Activate short form of the help. } --list { Activate list form of the help. } --full { Activate full form of the help. }} arguments {cmdname {code ?* desc { The entire command line, the name of the command to get help for. This can be several words. }}}} {hammer nail} {desc workbench options {--driver force --force {Alias of --driver.}} arguments {supply {code ?* desc magazine}}} {hammer help} {desc {Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full.} options {--short { Activate short form of the help. } --list { Activate list form of the help. } --full { Activate full form of the help. }} arguments {cmdname {code ?* desc { The entire command line, the name of the command to get help for. This can be several words. }}}} help {desc {Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full.} options {--short { Activate short form of the help. } --list { Activate list form of the help. } --full { Activate full form of the help. }} arguments {cmdname {code ?* desc { The entire command line, the name of the command to get help for. This can be several words. }}}}} test xo-help-1.1 {help structure, inverted boolean option} -body { xo create x foo { description TEST private nail { description workbench option no-driver force { list ; alias force } } ::wall } x help } -cleanup { x destroy } -result {nail {desc workbench options {--driver {Complementary alias of --no-driver.} --force {Alias of --no-driver.} --no-driver force} arguments {}} help {desc {Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full.} options {--short { Activate short form of the help. } --list { Activate list form of the help. } --full { Activate full form of the help. }} arguments {cmdname {code ?* desc { The entire command line, the name of the command to get help for. This can be several words. }}}}} # # ## ### ##### ######## ############# ##################### test xo-help-2.0 {full - formatting help structure} -body { HelpLarge full } -result {bar aloha [OPTIONS] yoyo ?jump? run... hawaii --lulu loop --no-lulu Complementary alias of --lulu. yoyo height jump gate run lane bar help [OPTIONS] ?cmdname...? Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. --short Activate short form of the help. --list Activate list form of the help. --full Activate full form of the help. cmdname The entire command line, the name of the command to get help for. This can be several words. snafu aloha [OPTIONS] yoyo ?jump? run... hawaii --lulu loop --no-lulu Complementary alias of --lulu. yoyo height jump gate run lane snafu help [OPTIONS] ?cmdname...? Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. --short Activate short form of the help. --list Activate list form of the help. --full Activate full form of the help. cmdname The entire command line, the name of the command to get help for. This can be several words. tool pliers help [OPTIONS] ?cmdname...? Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. --short Activate short form of the help. --list Activate list form of the help. --full Activate full form of the help. cmdname The entire command line, the name of the command to get help for. This can be several words. tool hammer nail [OPTIONS] ?supply...? workbench --driver force --force Alias of --driver. supply magazine tool hammer help [OPTIONS] ?cmdname...? Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. --short Activate short form of the help. --list Activate list form of the help. --full Activate full form of the help. cmdname The entire command line, the name of the command to get help for. This can be several words. tool help [OPTIONS] ?cmdname...? Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. --short Activate short form of the help. --list Activate list form of the help. --full Activate full form of the help. cmdname The entire command line, the name of the command to get help for. This can be several words. hammer nail [OPTIONS] ?supply...? workbench --driver force --force Alias of --driver. supply magazine hammer help [OPTIONS] ?cmdname...? Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. --short Activate short form of the help. --list Activate list form of the help. --full Activate full form of the help. cmdname The entire command line, the name of the command to get help for. This can be several words. help [OPTIONS] ?cmdname...? Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. --short Activate short form of the help. --list Activate list form of the help. --full Activate full form of the help. cmdname The entire command line, the name of the command to get help for. This can be several words. } test xo-help-2.1 {full formatting - help structure, inverted boolean option} -body { HelpSmall full } -result {nail [OPTIONS] workbench --driver Complementary alias of --no-driver. --force Alias of --no-driver. --no-driver force help [OPTIONS] ?cmdname...? Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. --short Activate short form of the help. --list Activate list form of the help. --full Activate full form of the help. cmdname The entire command line, the name of the command to get help for. This can be several words. } # # ## ### ##### ######## ############# ##################### test xo-help-3.0 {short - formatting help structure} -body { HelpLarge short } -result {bar aloha [OPTIONS] yoyo ?jump? run... hawaii bar help [OPTIONS] ?cmdname...? Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. snafu aloha [OPTIONS] yoyo ?jump? run... hawaii snafu help [OPTIONS] ?cmdname...? Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. tool pliers help [OPTIONS] ?cmdname...? Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. tool hammer nail [OPTIONS] ?supply...? workbench tool hammer help [OPTIONS] ?cmdname...? Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. tool help [OPTIONS] ?cmdname...? Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. hammer nail [OPTIONS] ?supply...? workbench hammer help [OPTIONS] ?cmdname...? Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. help [OPTIONS] ?cmdname...? Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. } test xo-help-3.1 {short formatting - help structure, inverted boolean option} -body { HelpSmall short } -result {nail [OPTIONS] workbench help [OPTIONS] ?cmdname...? Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. } # # ## ### ##### ######## ############# ##################### test xo-help-4.0 {list - formatting help structure} -body { HelpLarge list } -result { bar aloha [OPTIONS] yoyo ?jump? run... bar help [OPTIONS] ?cmdname...? snafu aloha [OPTIONS] yoyo ?jump? run... snafu help [OPTIONS] ?cmdname...? tool pliers help [OPTIONS] ?cmdname...? tool hammer nail [OPTIONS] ?supply...? tool hammer help [OPTIONS] ?cmdname...? tool help [OPTIONS] ?cmdname...? hammer nail [OPTIONS] ?supply...? hammer help [OPTIONS] ?cmdname...? help [OPTIONS] ?cmdname...?} test xo-help-4.1 {list formatting - help structure, inverted boolean option} -body { HelpSmall list } -result { nail [OPTIONS] help [OPTIONS] ?cmdname...?} # # ## ### ##### ######## ############# ##################### return |
Changes to tests/xo_main.tests.
︙ | ︙ | |||
36 37 38 39 40 41 42 | xo create OBJ NAME SPEC X } -returnCodes error \ -result {wrong # args: should be "xo create obj name spec"} # # ## ### ##### ######## ############# ##################### ## Basic officer, knows nothing. create/new with proper arguments. | | | | | | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | xo create OBJ NAME SPEC X } -returnCodes error \ -result {wrong # args: should be "xo create obj name spec"} # # ## ### ##### ######## ############# ##################### ## Basic officer, knows nothing. create/new with proper arguments. test xo-main-2.0 {new, nothing but auto-help} -setup { set x [xo new foo {}] } -body { list [$x known] [$x hasdefault] } -cleanup { $x destroy unset x } -result {help 0} test xo-main-2.1 {create, nothing but auto-help} -setup { xo create x foo {} } -body { list [x known] [x hasdefault] } -cleanup { x destroy } -result {help 0} # # ## ### ##### ######## ############# ##################### return |
Changes to tests/xo_officer.tests.
︙ | ︙ | |||
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | x destroy } -result { foo = { description: 'TEST' default: bar store (K): 'D' bar --> bar pliers --> pliers snafu --> bar tool --> tool } foo bar = { description: '' no default store (K): 'D' } foo tool = { description: '' default: pliers store (K): 'D' store (U): 'V' hammer --> hammer pliers --> pliers } foo tool hammer = { description: '' no default store (K): 'D' store (U): 'V' } foo tool pliers = { description: '' no default store (K): 'D' store (U): 'V' } } # # ## ### ##### ######## ############# ##################### ## Error cases of the action DSL. test xo-officer-2.0 {officer/action DSL, officer, wrong\#args} -setup { | > > > > > | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | x destroy } -result { foo = { description: 'TEST' default: bar store (K): 'D' bar --> bar help --> help pliers --> pliers snafu --> bar tool --> tool } foo bar = { description: '' no default store (K): 'D' help --> help } foo tool = { description: '' default: pliers store (K): 'D' store (U): 'V' hammer --> hammer help --> help pliers --> pliers } foo tool hammer = { description: '' no default store (K): 'D' store (U): 'V' help --> help } foo tool pliers = { description: '' no default store (K): 'D' store (U): 'V' help --> help } } # # ## ### ##### ######## ############# ##################### ## Error cases of the action DSL. test xo-officer-2.0 {officer/action DSL, officer, wrong\#args} -setup { |
︙ | ︙ |
Changes to xo_help.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## -*- tcl -*- # # ## ### ##### ######## ############# ##################### ## XO - Help - Help support. # # ## ### ##### ######## ############# ##################### ## Requisites package require Tcl 8.5 package require textutil::adjust package require xo::util package require linenoise # # ## ### ##### ######## ############# ##################### ## Definition namespace eval ::xo { namespace export help namespace ensemble create | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## -*- tcl -*- # # ## ### ##### ######## ############# ##################### ## XO - Help - Help support. # # ## ### ##### ######## ############# ##################### ## Requisites package require Tcl 8.5 package require textutil::adjust package require xo::util package require linenoise package require lambda # # ## ### ##### ######## ############# ##################### ## Definition namespace eval ::xo { namespace export help namespace ensemble create |
︙ | ︙ | |||
57 58 59 60 61 62 63 | lappend map @options@ [join $options \n] lappend map @actor@ $actor $actor learn [string map $map {private help { description { Retrieve help for a command or command set. Without arguments help for all commands is given. | | | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | lappend map @options@ [join $options \n] lappend map @actor@ $actor $actor learn [string map $map {private help { description { Retrieve help for a command or command set. Without arguments help for all commands is given. The default format is --full. } @options@ state format { Format of the help to generate. This field is fed by the options @formats@. } { default full } input cmdname { |
︙ | ︙ |