1 | package require Rappture |
---|
2 | |
---|
3 | Rappture::library "rplib_test.xml" |
---|
4 | |
---|
5 | puts [library0 get input.(max).current] |
---|
6 | puts [library0 get input.(max)] |
---|
7 | |
---|
8 | library0 put -append yes -id 1 input.(max).current "9" |
---|
9 | |
---|
10 | puts [library0 xml] |
---|
11 | |
---|
12 | set outp "\nTESTING ELEMENT" |
---|
13 | append outp "\nelement -as path input.(max): " |
---|
14 | append outp [library0 element -as path input.(max)] |
---|
15 | append outp "\nelement -as component input.(max): " |
---|
16 | append outp [library0 element -as component input.(max)] |
---|
17 | append outp "\nelement -as type input.(max): " |
---|
18 | append outp [library0 element -as type input.(max)] |
---|
19 | append outp "\nelement -as id input.(max): " |
---|
20 | append outp [library0 element -as id input.(max)] |
---|
21 | append outp "\nelement -as object input.(max): " |
---|
22 | append outp [library0 element -as object input.(max)] |
---|
23 | puts $outp |
---|
24 | |
---|
25 | set outp "\nTESTING PARENT" |
---|
26 | append outp "\nparent -as path input.(max).current: " |
---|
27 | append outp [library0 parent -as path input.(max).current] |
---|
28 | append outp "\nparent -as component input.(max).current: " |
---|
29 | append outp [library0 parent -as component input.(max).current] |
---|
30 | append outp "\nparent -as type input.(max).current: " |
---|
31 | append outp [library0 parent -as type input.(max).current] |
---|
32 | append outp "\nparent -as id input.(max).current: " |
---|
33 | append outp [library0 parent -as id input.(max).current] |
---|
34 | append outp "\nparent -as object input.(max).current: " |
---|
35 | append outp [library0 parent -as object input.(max).current] |
---|
36 | |
---|
37 | append outp "\nparent input.(max): " |
---|
38 | append outp [library0 parent input.(max)] |
---|
39 | append outp "\nparent input: " |
---|
40 | append outp [library0 parent input] |
---|
41 | append outp "\nparent current: " |
---|
42 | append outp [library0 parent current] |
---|
43 | puts $outp |
---|
44 | |
---|
45 | set outp "\nTESTING CHILDREN" |
---|
46 | append outp "\nchildren input: " |
---|
47 | append outp [library0 children input] |
---|
48 | append outp "\nchildren -as path input: " |
---|
49 | append outp [library0 children -as path input] |
---|
50 | append outp "\nchildren -as id -type number input: " |
---|
51 | append outp [library0 children -as id -type number input] |
---|
52 | append outp "\nchildren -as object input: " |
---|
53 | append outp [library0 children -as object input] |
---|
54 | puts $outp |
---|
55 | |
---|
56 | puts "Copying min and max" |
---|
57 | library0 copy input.test from input.(min) |
---|
58 | library0 copy input.test from input.(max) |
---|
59 | puts [library0 xml] |
---|
60 | |
---|
61 | puts "Removing min and max" |
---|
62 | library0 remove input.test.(min) |
---|
63 | library0 remove input.test.(max) |
---|
64 | puts [library0 xml] |
---|
65 | |
---|
66 | puts "Removing library0" |
---|
67 | library0 remove |
---|
68 | |
---|
69 | puts "Printing XML" |
---|
70 | puts [library0 xml] |
---|
71 | |
---|
72 | puts "opening new library" |
---|
73 | set libObj1 [Rappture::library "rplib_test.xml"] |
---|
74 | set libObj2 [Rappture::library "rplib_test.xml"] |
---|
75 | puts "libObj1 = " |
---|
76 | puts $libObj1 |
---|
77 | |
---|
78 | puts "COPYING BETWEEN LIBS" |
---|
79 | $libObj1 copy "input.test" from $libObj2 "input.(max)" |
---|
80 | puts [$libObj1 xml] |
---|
81 | |
---|
82 | puts "COPYING BETWEEN LIBS - this should fail" |
---|
83 | set err [$libObj1 copy "input.test" from put "input.(max)"] |
---|
84 | puts $err |
---|
85 | |
---|
86 | #puts [$libObj xml] |
---|
87 | puts "isvalid test1: " |
---|
88 | puts [Rappture::library isvalid $libObj1] |
---|
89 | puts "isvalid test2: " |
---|
90 | puts [Rappture::library isvalid library0] |
---|
91 | puts "isvalid test3: " |
---|
92 | puts [Rappture::library isvalid puts] |
---|
93 | puts "testing lib0's xml" |
---|
94 | puts [library0 xml] |
---|
95 | |
---|
96 | puts "TEST ISA" |
---|
97 | puts "$libObj1 isa ::Rappture::LibraryObj : " |
---|
98 | puts [$libObj1 isa ::Rappture::LibraryObj] |
---|
99 | puts "$libObj1 isa ::Rappture::Table : " |
---|
100 | puts [$libObj1 isa ::Rappture::Table] |
---|
101 | #puts "$libObj1 isa ::Rappture::LibraryObj ::Rappture::LibraryObj: " |
---|
102 | #puts [$libObj1 isa ::Rappture::LibraryObj ::Rappture::LibraryObj] |
---|
103 | |
---|
104 | puts "TEST DIFF" |
---|
105 | puts "changing the value of input.number(min) to 4" |
---|
106 | $libObj1 put input.number(min).current "4" |
---|
107 | $libObj2 put input.number(jdjd).current "4" |
---|
108 | puts "$libObj1 diff $libObj2" |
---|
109 | puts [$libObj1 diff $libObj2] |
---|
110 | #foreach {op vpath oldval newval} [$libObj1 diff $libObj2] { |
---|
111 | # puts "op |
---|
112 | |
---|