Changeset 424 for trunk/src/tcl/tests/parent.test
- Timestamp:
- May 1, 2006, 11:16:11 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tcl/tests/parent.test
r403 r424 18 18 namespace import -force ::tcltest::* 19 19 } 20 20 21 catch {unset lib} 22 set lib [Rappture::library rplib_test.xml] 21 23 22 24 #---------------------------------------------------------- … … 25 27 #---------------------------------------------------------- 26 28 test library-6.0.1 {parent command 0 arg} { 27 catch {unset lib}28 set lib [Rappture::library rplib_test.xml]29 29 $lib parent 30 30 } {} 31 31 test library-6.1.1 {parent command path as default 1 arg} { 32 catch {unset lib}33 set lib [Rappture::library rplib_test.xml]34 32 $lib parent "input" 35 33 } {} 36 34 test library-6.1.2 {parent command path w/ id as default 1 arg} { 37 catch {unset lib}38 set lib [Rappture::library rplib_test.xml]39 35 $lib parent "input.number(min)" 40 36 } {input} 41 37 test library-6.1.3 {parent command non-existant path 1 arg} { 42 catch {unset lib}43 set lib [Rappture::library rplib_test.xml]44 38 $lib parent "kdsf.werw(we12)" 45 39 } {} 46 40 test library-6.2.1 {parent command path 2 arg} { 47 catch {unset lib}48 set lib [Rappture::library rplib_test.xml]49 41 list [catch {$lib parent "input.number(min)" "wreew"} msg] $msg 50 42 } {1 {wrong # args: should be "parent ?-as <fval>? ?<path>?"}} 51 43 test library-6.3.1 {parent command path -as flag no option} { 52 catch {unset lib}53 set lib [Rappture::library rplib_test.xml]54 44 list [catch {$lib parent -as} msg] $msg 55 } {1 {bad flavor "" for -as: should be component, id, type, path, object}}45 } {1 {bad flavor "" for -as: should be component, id, object, path, type}} 56 46 test library-6.3.2 {parent command path -as flag component path with id} { 57 catch {unset lib}58 set lib [Rappture::library rplib_test.xml]59 47 $lib parent -as component "input.number(max).default" 60 48 } {number(max)} 61 49 test library-6.3.3 {parent command path -as flag id path with id} { 62 catch {unset lib}63 set lib [Rappture::library rplib_test.xml]64 50 $lib parent -as id "input.number(max).default" 65 51 } {max} 66 52 test library-6.3.4 {parent command path -as flag type path with id} { 67 catch {unset lib}68 set lib [Rappture::library rplib_test.xml]69 53 $lib parent -as type "input.number(max).default" 70 54 } {number} 71 55 test library-6.3.5 {parent command path -as path type path with id} { 72 catch {unset lib}73 set lib [Rappture::library rplib_test.xml]74 56 $lib parent -as path "input.number(max).default" 75 } { .input.number(max)}57 } {input.number(max)} 76 58 test library-6.3.6 {parent command path -as object type path with id} { 77 catch {unset lib}78 set lib [Rappture::library rplib_test.xml]79 59 set libNew [$lib parent -as object "input.number(max).default"] 80 60 list [catch {$libNew isa ::Rappture::LibraryObj} msg] $msg 81 61 } {0 1} 82 62 test library-6.3.7 {parent command path -as junk type path with id} { 83 catch {unset lib}84 set lib [Rappture::library rplib_test.xml]85 63 list [catch {$lib parent -as junk "input.number(max)"} msg] $msg 86 } {1 {bad flavor "junk" for -as: should be component, id, object, path, type}}64 } {1 {bad flavor "junk": should be component, id, object, path, type}} 87 65 test library-6.3.8 {parent command path -as component, path does not exist} { 88 catch {unset lib}89 set lib [Rappture::library rplib_test.xml]90 66 $lib parent -as component "input.test(we).current" 91 67 } {} 92 68 test library-6.3.9 {parent command path -as id, path does not exist} { 93 catch {unset lib}94 set lib [Rappture::library rplib_test.xml]95 69 $lib parent -as id "input.test(we).current" 96 70 } {} 97 71 test library-6.3.10 {parent command path -as type, path does not exist} { 98 catch {unset lib}99 set lib [Rappture::library rplib_test.xml]100 72 $lib parent -as type "input.test(we).current" 101 73 } {} 102 74 test library-6.3.11 {parent command path -as path, path does not exist} { 103 catch {unset lib}104 set lib [Rappture::library rplib_test.xml]105 75 $lib parent -as path "input.test(we).current" 106 76 } {} 107 77 test library-6.3.12 {parent command path -as object, path does not exist} { 108 catch {unset lib}109 set lib [Rappture::library rplib_test.xml]110 78 $lib parent -as object "input.test(we).current" 111 } { ::libraryObj18}79 } {} 112 80 test library-6.4.1 {parent command path -junk path} { 113 catch {unset lib}114 set lib [Rappture::library rplib_test.xml]115 81 list [catch {$lib parent -junk "input"} msg] $msg 116 82 } {1 {bad option "-junk": should be -as}}
Note: See TracChangeset
for help on using the changeset viewer.