source: trunk/lang/tcl/tcl_test.tcl @ 2080

Last change on this file since 2080 was 224, checked in by dkearney, 19 years ago

added support for following functions in rappture core
diff
value
entities
added support for diff function in tcl bindings.

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