Fossil SCM

Add test cases for fossil json. Improve the test suite to support a way to treat expected non-zero status exits from fossil as success when warrented. Made minor bug fixes to the test framework, and to several test cases unrelated to JSON support.

rberteig 2016-02-06 02:46 trunk merge
Commit 62627615e7fd4375e0430546a5a42e01077bb888
+4 -4
--- test/amend.test
+++ test/amend.test
@@ -221,11 +221,11 @@
221221
}
222222
set sc 0
223223
foreach badformat $badformats {
224224
incr sc
225225
set datetime [clock format $timestamp -format $badformat -gmt 1]
226
- fossil amend $UUIDINIT -date $datetime
226
+ fossil amend $UUIDINIT -date $datetime -expectError
227227
test amend-date-2.$sc {[string first "YYYY-MM-DD HH:MM:SS" $RESULT] != -1}
228228
}
229229
230230
########################################
231231
# Test: -hide #
@@ -261,11 +261,11 @@
261261
fossil tag ls --raw $UUIDC
262262
test amend-close-1.2 {[string first "closed" $RESULT] != -1}
263263
fossil timeline -n 1
264264
test amend-close-1.3 {[string match {*Marked*"Closed".*} $RESULT]}
265265
write_file datafile "cllf"
266
-fossil commit -m "should fail"
266
+fossil commit -m "should fail" -expectError
267267
test amend-close-2 {[string first "closed leaf" $RESULT] != -1}
268268
269269
set UUID3 UUID3
270270
fossil revert
271271
fossil update trunk
@@ -285,11 +285,11 @@
285285
fossil timeline -n 1
286286
test amend-close-3.3 {
287287
[string match "*Add*propagating*\"closed\".*" $RESULT]
288288
}
289289
write_file datafile "changed"
290
-fossil commit -m "should fail"
290
+fossil commit -m "should fail" -expectError
291291
test amend-close-3.4 {[string first "closed leaf" $RESULT] != -1}
292292
293293
########################################
294294
# Test: -tag/-cancel #
295295
########################################
@@ -399,7 +399,7 @@
399399
}
400400
401401
########################################
402402
# Test: NULL UUID #
403403
########################################
404
-fossil amend {} -close
404
+fossil amend {} -close -expectError
405405
test amend-null-uuid {$CODE && [string first "no such check-in" $RESULT] != -1}
406406
--- test/amend.test
+++ test/amend.test
@@ -221,11 +221,11 @@
221 }
222 set sc 0
223 foreach badformat $badformats {
224 incr sc
225 set datetime [clock format $timestamp -format $badformat -gmt 1]
226 fossil amend $UUIDINIT -date $datetime
227 test amend-date-2.$sc {[string first "YYYY-MM-DD HH:MM:SS" $RESULT] != -1}
228 }
229
230 ########################################
231 # Test: -hide #
@@ -261,11 +261,11 @@
261 fossil tag ls --raw $UUIDC
262 test amend-close-1.2 {[string first "closed" $RESULT] != -1}
263 fossil timeline -n 1
264 test amend-close-1.3 {[string match {*Marked*"Closed".*} $RESULT]}
265 write_file datafile "cllf"
266 fossil commit -m "should fail"
267 test amend-close-2 {[string first "closed leaf" $RESULT] != -1}
268
269 set UUID3 UUID3
270 fossil revert
271 fossil update trunk
@@ -285,11 +285,11 @@
285 fossil timeline -n 1
286 test amend-close-3.3 {
287 [string match "*Add*propagating*\"closed\".*" $RESULT]
288 }
289 write_file datafile "changed"
290 fossil commit -m "should fail"
291 test amend-close-3.4 {[string first "closed leaf" $RESULT] != -1}
292
293 ########################################
294 # Test: -tag/-cancel #
295 ########################################
@@ -399,7 +399,7 @@
399 }
400
401 ########################################
402 # Test: NULL UUID #
403 ########################################
404 fossil amend {} -close
405 test amend-null-uuid {$CODE && [string first "no such check-in" $RESULT] != -1}
406
--- test/amend.test
+++ test/amend.test
@@ -221,11 +221,11 @@
221 }
222 set sc 0
223 foreach badformat $badformats {
224 incr sc
225 set datetime [clock format $timestamp -format $badformat -gmt 1]
226 fossil amend $UUIDINIT -date $datetime -expectError
227 test amend-date-2.$sc {[string first "YYYY-MM-DD HH:MM:SS" $RESULT] != -1}
228 }
229
230 ########################################
231 # Test: -hide #
@@ -261,11 +261,11 @@
261 fossil tag ls --raw $UUIDC
262 test amend-close-1.2 {[string first "closed" $RESULT] != -1}
263 fossil timeline -n 1
264 test amend-close-1.3 {[string match {*Marked*"Closed".*} $RESULT]}
265 write_file datafile "cllf"
266 fossil commit -m "should fail" -expectError
267 test amend-close-2 {[string first "closed leaf" $RESULT] != -1}
268
269 set UUID3 UUID3
270 fossil revert
271 fossil update trunk
@@ -285,11 +285,11 @@
285 fossil timeline -n 1
286 test amend-close-3.3 {
287 [string match "*Add*propagating*\"closed\".*" $RESULT]
288 }
289 write_file datafile "changed"
290 fossil commit -m "should fail" -expectError
291 test amend-close-3.4 {[string first "closed leaf" $RESULT] != -1}
292
293 ########################################
294 # Test: -tag/-cancel #
295 ########################################
@@ -399,7 +399,7 @@
399 }
400
401 ########################################
402 # Test: NULL UUID #
403 ########################################
404 fossil amend {} -close -expectError
405 test amend-null-uuid {$CODE && [string first "no such check-in" $RESULT] != -1}
406
+3 -3
--- test/clean.test
+++ test/clean.test
@@ -136,11 +136,11 @@
136136
test clean-22 {[normalize_result] eq {f2
137137
f4}}
138138
139139
###############################################################################
140140
141
-fossil undo
141
+fossil undo -expectError
142142
test clean-23 {[normalize_result] eq {nothing to undo}}
143143
144144
###############################################################################
145145
146146
# clean w/undo disabled, force, 1 file < 10MiB, 1 file > 10MiB
@@ -152,11 +152,11 @@
152152
fossil extra
153153
test clean-25 {[normalize_result] eq {}}
154154
155155
###############################################################################
156156
157
-fossil undo
157
+fossil undo -expectError
158158
test clean-26 {[normalize_result] eq {nothing to undo}}
159159
160160
###############################################################################
161161
162162
write_file f5 "f5 line"
@@ -178,12 +178,12 @@
178178
fossil extra
179179
test clean-29 {[normalize_result] eq {}}
180180
181181
###############################################################################
182182
183
-fossil undo
183
+fossil undo -expectError
184184
test clean-30 {[normalize_result] eq {nothing to undo}}
185185
186186
###############################################################################
187187
188188
fossil extra
189189
test clean-31 {[normalize_result] eq {}}
190190
191191
ADDED test/json.test
--- test/clean.test
+++ test/clean.test
@@ -136,11 +136,11 @@
136 test clean-22 {[normalize_result] eq {f2
137 f4}}
138
139 ###############################################################################
140
141 fossil undo
142 test clean-23 {[normalize_result] eq {nothing to undo}}
143
144 ###############################################################################
145
146 # clean w/undo disabled, force, 1 file < 10MiB, 1 file > 10MiB
@@ -152,11 +152,11 @@
152 fossil extra
153 test clean-25 {[normalize_result] eq {}}
154
155 ###############################################################################
156
157 fossil undo
158 test clean-26 {[normalize_result] eq {nothing to undo}}
159
160 ###############################################################################
161
162 write_file f5 "f5 line"
@@ -178,12 +178,12 @@
178 fossil extra
179 test clean-29 {[normalize_result] eq {}}
180
181 ###############################################################################
182
183 fossil undo
184 test clean-30 {[normalize_result] eq {nothing to undo}}
185
186 ###############################################################################
187
188 fossil extra
189 test clean-31 {[normalize_result] eq {}}
190
191 DDED test/json.test
--- test/clean.test
+++ test/clean.test
@@ -136,11 +136,11 @@
136 test clean-22 {[normalize_result] eq {f2
137 f4}}
138
139 ###############################################################################
140
141 fossil undo -expectError
142 test clean-23 {[normalize_result] eq {nothing to undo}}
143
144 ###############################################################################
145
146 # clean w/undo disabled, force, 1 file < 10MiB, 1 file > 10MiB
@@ -152,11 +152,11 @@
152 fossil extra
153 test clean-25 {[normalize_result] eq {}}
154
155 ###############################################################################
156
157 fossil undo -expectError
158 test clean-26 {[normalize_result] eq {nothing to undo}}
159
160 ###############################################################################
161
162 write_file f5 "f5 line"
@@ -178,12 +178,12 @@
178 fossil extra
179 test clean-29 {[normalize_result] eq {}}
180
181 ###############################################################################
182
183 fossil undo -expectError
184 test clean-30 {[normalize_result] eq {nothing to undo}}
185
186 ###############################################################################
187
188 fossil extra
189 test clean-31 {[normalize_result] eq {}}
190
191 DDED test/json.test
--- a/test/json.test
+++ b/test/json.test
@@ -0,0 +1,43 @@
1
+#
2
+env-RC-1102env#write_file bad.sql {
3
+##}
4
+##1102#
5
+# Co#. What about Win?timeline/checkin $U1Cookie1 {$CODE =11http-timeline#
6
+# Cotimeline/checkin $U1Cookie knownBughttp-timeline2
7
+#
8
+# Co
9
+env-RC-1102env#write_file bad.sql {
10
+##}
11
+##1102#
12
+# Co#. What about Win?timeline/checkin $U1Cookie1 {$CODE =11http-timeline#
13
+# Cotimeline/checkin $U1Cookie knownBughttp-timeline2
14
+#
15
+# CoC}
16
+$::RESULT; ; repo_initrepo_initsqlite3 bad.fossil <bad.sql
17
+#. What about Win?help -a
18
+if {[stri (fossil help -a)
19
+ v-RC-1102env#write_file bad.e_file bad.sql {
20
+##}
21
+##1102#
22
+# Co#. What about Win?timeline/checkin $U1Cookie1 {$CODE =11http-timeline#
23
+# Cotimeline/checkin $U1Cookie knownBughttp-timeline2
24
+#
25
+# Co
26
+env-RC-1102env#write_file bad.sql {
27
+##}
28
+##1102#
29
+# Co#. What about Win?timeline/checkin $U1Cookie1 {$CODE =11http-timeline#
30
+# Cotimeline/checkin $U1Cookie knownBughttp-timeline2
31
+#
32
+."; return
33
+}if {$RESULTset JR [::json::RC-1102env#write_file bad.sql e bad.sql {
34
+##}
35
+##1102#
36
+# Co#. What about Win?timeline/checkin $U1Cookie1 {$CODE =11http-timeline#
37
+# Cotimeline/checkin $U1Cookie knownBughttp-timeline2
38
+#
39
+# Co
40
+env-RC-1102env#write_file bad.sql {
41
+##}
42
+##1102#
43
+# Co#. What about Win?timeline/checkin $U1Cookie1 {$CODE =11h::json::::json::::json:: knownBug
--- a/test/json.test
+++ b/test/json.test
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/test/json.test
+++ b/test/json.test
@@ -0,0 +1,43 @@
1 #
2 env-RC-1102env#write_file bad.sql {
3 ##}
4 ##1102#
5 # Co#. What about Win?timeline/checkin $U1Cookie1 {$CODE =11http-timeline#
6 # Cotimeline/checkin $U1Cookie knownBughttp-timeline2
7 #
8 # Co
9 env-RC-1102env#write_file bad.sql {
10 ##}
11 ##1102#
12 # Co#. What about Win?timeline/checkin $U1Cookie1 {$CODE =11http-timeline#
13 # Cotimeline/checkin $U1Cookie knownBughttp-timeline2
14 #
15 # CoC}
16 $::RESULT; ; repo_initrepo_initsqlite3 bad.fossil <bad.sql
17 #. What about Win?help -a
18 if {[stri (fossil help -a)
19 v-RC-1102env#write_file bad.e_file bad.sql {
20 ##}
21 ##1102#
22 # Co#. What about Win?timeline/checkin $U1Cookie1 {$CODE =11http-timeline#
23 # Cotimeline/checkin $U1Cookie knownBughttp-timeline2
24 #
25 # Co
26 env-RC-1102env#write_file bad.sql {
27 ##}
28 ##1102#
29 # Co#. What about Win?timeline/checkin $U1Cookie1 {$CODE =11http-timeline#
30 # Cotimeline/checkin $U1Cookie knownBughttp-timeline2
31 #
32 ."; return
33 }if {$RESULTset JR [::json::RC-1102env#write_file bad.sql e bad.sql {
34 ##}
35 ##1102#
36 # Co#. What about Win?timeline/checkin $U1Cookie1 {$CODE =11http-timeline#
37 # Cotimeline/checkin $U1Cookie knownBughttp-timeline2
38 #
39 # Co
40 env-RC-1102env#write_file bad.sql {
41 ##}
42 ##1102#
43 # Co#. What about Win?timeline/checkin $U1Cookie1 {$CODE =11h::json::::json::::json:: knownBug
--- test/merge5.test
+++ test/merge5.test
@@ -222,11 +222,11 @@
222222
35815cf5804e8933eab64ae34e00bbb381be72c5 four.txt
223223
da5c8346496f3421cb58f84b6e59e9531d9d424d one.txt
224224
ed24d19d726d173f18dbf4a9a0f8514daa3e3ca4 three.txt
225225
278a402316510f6ae4a77186796a6bde78c7dbc1 two.txt
226226
}
227
-fossil merge br4
227
+fossil merge br4 -expectError
228228
checkout-test 121 {
229229
35815cf5804e8933eab64ae34e00bbb381be72c5 four.txt
230230
ed24d19d726d173f18dbf4a9a0f8514daa3e3ca4 three.txt
231231
278a402316510f6ae4a77186796a6bde78c7dbc1 two.txt
232232
}
@@ -235,11 +235,11 @@
235235
checkout-test 122 {
236236
6e167b139c294bed560e2e30b352361b101e1f39 four.txt
237237
ed24d19d726d173f18dbf4a9a0f8514daa3e3ca4 three.txt
238238
278a402316510f6ae4a77186796a6bde78c7dbc1 two.txt
239239
}
240
-fossil merge br1
240
+fossil merge br1 -expectError
241241
checkout-test 123 {
242242
6e167b139c294bed560e2e30b352361b101e1f39 four.txt
243243
ed24d19d726d173f18dbf4a9a0f8514daa3e3ca4 three.txt
244244
278a402316510f6ae4a77186796a6bde78c7dbc1 two.txt
245245
}
246246
--- test/merge5.test
+++ test/merge5.test
@@ -222,11 +222,11 @@
222 35815cf5804e8933eab64ae34e00bbb381be72c5 four.txt
223 da5c8346496f3421cb58f84b6e59e9531d9d424d one.txt
224 ed24d19d726d173f18dbf4a9a0f8514daa3e3ca4 three.txt
225 278a402316510f6ae4a77186796a6bde78c7dbc1 two.txt
226 }
227 fossil merge br4
228 checkout-test 121 {
229 35815cf5804e8933eab64ae34e00bbb381be72c5 four.txt
230 ed24d19d726d173f18dbf4a9a0f8514daa3e3ca4 three.txt
231 278a402316510f6ae4a77186796a6bde78c7dbc1 two.txt
232 }
@@ -235,11 +235,11 @@
235 checkout-test 122 {
236 6e167b139c294bed560e2e30b352361b101e1f39 four.txt
237 ed24d19d726d173f18dbf4a9a0f8514daa3e3ca4 three.txt
238 278a402316510f6ae4a77186796a6bde78c7dbc1 two.txt
239 }
240 fossil merge br1
241 checkout-test 123 {
242 6e167b139c294bed560e2e30b352361b101e1f39 four.txt
243 ed24d19d726d173f18dbf4a9a0f8514daa3e3ca4 three.txt
244 278a402316510f6ae4a77186796a6bde78c7dbc1 two.txt
245 }
246
--- test/merge5.test
+++ test/merge5.test
@@ -222,11 +222,11 @@
222 35815cf5804e8933eab64ae34e00bbb381be72c5 four.txt
223 da5c8346496f3421cb58f84b6e59e9531d9d424d one.txt
224 ed24d19d726d173f18dbf4a9a0f8514daa3e3ca4 three.txt
225 278a402316510f6ae4a77186796a6bde78c7dbc1 two.txt
226 }
227 fossil merge br4 -expectError
228 checkout-test 121 {
229 35815cf5804e8933eab64ae34e00bbb381be72c5 four.txt
230 ed24d19d726d173f18dbf4a9a0f8514daa3e3ca4 three.txt
231 278a402316510f6ae4a77186796a6bde78c7dbc1 two.txt
232 }
@@ -235,11 +235,11 @@
235 checkout-test 122 {
236 6e167b139c294bed560e2e30b352361b101e1f39 four.txt
237 ed24d19d726d173f18dbf4a9a0f8514daa3e3ca4 three.txt
238 278a402316510f6ae4a77186796a6bde78c7dbc1 two.txt
239 }
240 fossil merge br1 -expectError
241 checkout-test 123 {
242 6e167b139c294bed560e2e30b352361b101e1f39 four.txt
243 ed24d19d726d173f18dbf4a9a0f8514daa3e3ca4 three.txt
244 278a402316510f6ae4a77186796a6bde78c7dbc1 two.txt
245 }
246
+7 -1
--- test/tester.tcl
+++ test/tester.tcl
@@ -127,27 +127,33 @@
127127
# test expressions.
128128
#
129129
proc fossil_maybe_answer {answer args} {
130130
global fossilexe
131131
set cmd $fossilexe
132
+ set expectError 0
133
+ if {[lindex $args end] eq "-expectError"} {
134
+ set expectError 1
135
+ set args [lrange $args 0 end-1]
136
+ }
132137
foreach a $args {
133138
lappend cmd $a
134139
}
135140
protOut $cmd
136141
137142
flush stdout
138143
if {[string length $answer] > 0} {
144
+ protOut $answer
139145
set prompt_file [file join $::tempPath fossil_prompt_answer]
140146
write_file $prompt_file $answer\n
141147
set rc [catch {eval exec $cmd <$prompt_file} result]
142148
file delete $prompt_file
143149
} else {
144150
set rc [catch {eval exec $cmd} result]
145151
}
146152
global RESULT CODE
147153
set CODE $rc
148
- if {$rc} {
154
+ if {($rc && !$expectError) || (!$rc && $expectError)} {
149155
protOut "ERROR: $result" 1
150156
} elseif {$::VERBOSE} {
151157
protOut "RESULT: $result"
152158
}
153159
set RESULT $result
154160
--- test/tester.tcl
+++ test/tester.tcl
@@ -127,27 +127,33 @@
127 # test expressions.
128 #
129 proc fossil_maybe_answer {answer args} {
130 global fossilexe
131 set cmd $fossilexe
 
 
 
 
 
132 foreach a $args {
133 lappend cmd $a
134 }
135 protOut $cmd
136
137 flush stdout
138 if {[string length $answer] > 0} {
 
139 set prompt_file [file join $::tempPath fossil_prompt_answer]
140 write_file $prompt_file $answer\n
141 set rc [catch {eval exec $cmd <$prompt_file} result]
142 file delete $prompt_file
143 } else {
144 set rc [catch {eval exec $cmd} result]
145 }
146 global RESULT CODE
147 set CODE $rc
148 if {$rc} {
149 protOut "ERROR: $result" 1
150 } elseif {$::VERBOSE} {
151 protOut "RESULT: $result"
152 }
153 set RESULT $result
154
--- test/tester.tcl
+++ test/tester.tcl
@@ -127,27 +127,33 @@
127 # test expressions.
128 #
129 proc fossil_maybe_answer {answer args} {
130 global fossilexe
131 set cmd $fossilexe
132 set expectError 0
133 if {[lindex $args end] eq "-expectError"} {
134 set expectError 1
135 set args [lrange $args 0 end-1]
136 }
137 foreach a $args {
138 lappend cmd $a
139 }
140 protOut $cmd
141
142 flush stdout
143 if {[string length $answer] > 0} {
144 protOut $answer
145 set prompt_file [file join $::tempPath fossil_prompt_answer]
146 write_file $prompt_file $answer\n
147 set rc [catch {eval exec $cmd <$prompt_file} result]
148 file delete $prompt_file
149 } else {
150 set rc [catch {eval exec $cmd} result]
151 }
152 global RESULT CODE
153 set CODE $rc
154 if {($rc && !$expectError) || (!$rc && $expectError)} {
155 protOut "ERROR: $result" 1
156 } elseif {$::VERBOSE} {
157 protOut "RESULT: $result"
158 }
159 set RESULT $result
160
+28 -30
--- test/th1.test
+++ test/th1.test
@@ -913,64 +913,62 @@
913913
test th1-reinitialize-2 {$RESULT ne ""}
914914
915915
###############################################################################
916916
917917
#
918
-# NOTE: This test may fail if the command names do not always come out in a
919
-# deterministic order from TH1.
918
+# NOTE: This test will fail if the command names are added to TH1, or
919
+# moved from Tcl builds to plain or the reverse. Sorting the
920
+# command lists eliminates a dependence on order.
920921
#
921922
fossil test-th-eval "info commands"
922
-
923
+set sorted_result [lsort $RESULT]
924
+protOut "Sorted: $sorted_result"
925
+set base_commands {anoncap anycap array artifact break breakpoint catch\
926
+ checkout combobox continue date decorate dir enable_output encode64\
927
+ error expr for getParameter glob_match globalState hascap hasfeature\
928
+ html htmlize http httpize if info insertCsrf lindex linecount list\
929
+ llength lsearch markdown proc puts query randhex redirect regexp\
930
+ reinitialize rename render repository return searchable set\
931
+ setParameter setting stime string styleFooter styleHeader tclReady\
932
+ trace unset uplevel upvar utime verifyCsrf wiki}
933
+set tcl_commands {tclEval tclExpr tclInvoke tclIsSafe tclMakeSafe}
923934
if {$th1Tcl} {
924
- test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
925
- enable_output uplevel dir http expr glob_match utime styleFooter encode64\
926
- catch if tclReady searchable reinitialize combobox lindex tclIsSafe query\
927
- html anoncap randhex llength for set break regexp markdown styleHeader\
928
- puts return checkout decorate artifact trace wiki proc tclInvoke hascap\
929
- globalState continue getParameter hasfeature setting lsearch breakpoint\
930
- upvar render repository string unset setParameter list error info rename\
931
- tclExpr array anycap tclEval httpize tclMakeSafe}}
935
+ test th1-info-commands-1 {$sorted_result eq [lsort "$base_commands $tcl_commands"]}
932936
} else {
933
- test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
934
- enable_output uplevel dir http expr glob_match utime styleFooter encode64\
935
- catch if tclReady searchable reinitialize combobox lindex query html\
936
- anoncap randhex llength for set break regexp markdown styleHeader puts\
937
- return checkout decorate artifact trace wiki proc hascap globalState\
938
- continue getParameter hasfeature setting lsearch breakpoint upvar render\
939
- repository string unset setParameter list error info rename array anycap\
940
- httpize}}
941
-}
937
+ test th1-info-commands-1 {$sorted_result eq [lsort "$base_commands"]}
938
+}
939
+
942940
943941
###############################################################################
944942
945943
fossil test-th-eval "info vars"
946944
947945
if {$th1Hooks} {
948
- test th1-info-vars-1 {$RESULT eq \
949
- "th_stack_trace cmd_flags tcl_platform cmd_name cmd_args"}
946
+ test th1-info-vars-1 {[lsort $RESULT] eq \
947
+ [lsort "th_stack_trace cmd_flags tcl_platform cmd_name cmd_args"]}
950948
} else {
951949
test th1-info-vars-1 {$RESULT eq "tcl_platform"}
952950
}
953951
954952
###############################################################################
955953
956954
fossil test-th-eval "set x 1; info vars"
957955
958956
if {$th1Hooks} {
959
- test th1-info-vars-2 {$RESULT eq \
960
- "x th_stack_trace cmd_flags tcl_platform cmd_name cmd_args"}
957
+ test th1-info-vars-2 {[lsort $RESULT] eq \
958
+ [lsort "x th_stack_trace cmd_flags tcl_platform cmd_name cmd_args"]}
961959
} else {
962
- test th1-info-vars-2 {$RESULT eq "x tcl_platform"}
960
+ test th1-info-vars-2 {[lsort $RESULT] eq [lsort "x tcl_platform"]}
963961
}
964962
965963
###############################################################################
966964
967965
fossil test-th-eval "set x 1; unset x; info vars"
968966
969967
if {$th1Hooks} {
970
- test th1-info-vars-3 {$RESULT eq \
971
- "th_stack_trace cmd_flags tcl_platform cmd_name cmd_args"}
968
+ test th1-info-vars-3 {[lsort $RESULT] eq \
969
+ [lsort "th_stack_trace cmd_flags tcl_platform cmd_name cmd_args"]}
972970
} else {
973971
test th1-info-vars-3 {$RESULT eq "tcl_platform"}
974972
}
975973
976974
###############################################################################
@@ -981,14 +979,14 @@
981979
###############################################################################
982980
983981
fossil test-th-eval "set y 1; proc foo {} {set x 1; uplevel 1 {info vars}}; foo"
984982
985983
if {$th1Hooks} {
986
- test th1-info-vars-5 {$RESULT eq \
987
- "th_stack_trace y cmd_flags tcl_platform cmd_name cmd_args"}
984
+ test th1-info-vars-5 {[lsort $RESULT] eq \
985
+ [lsort "th_stack_trace y cmd_flags tcl_platform cmd_name cmd_args"]}
988986
} else {
989
- test th1-info-vars-5 {$RESULT eq "y tcl_platform"}
987
+ test th1-info-vars-5 {[lsort $RESULT] eq [lsort "y tcl_platform"]}
990988
}
991989
992990
###############################################################################
993991
994992
fossil test-th-eval "array exists foo"
995993
--- test/th1.test
+++ test/th1.test
@@ -913,64 +913,62 @@
913 test th1-reinitialize-2 {$RESULT ne ""}
914
915 ###############################################################################
916
917 #
918 # NOTE: This test may fail if the command names do not always come out in a
919 # deterministic order from TH1.
 
920 #
921 fossil test-th-eval "info commands"
922
 
 
 
 
 
 
 
 
 
 
923 if {$th1Tcl} {
924 test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
925 enable_output uplevel dir http expr glob_match utime styleFooter encode64\
926 catch if tclReady searchable reinitialize combobox lindex tclIsSafe query\
927 html anoncap randhex llength for set break regexp markdown styleHeader\
928 puts return checkout decorate artifact trace wiki proc tclInvoke hascap\
929 globalState continue getParameter hasfeature setting lsearch breakpoint\
930 upvar render repository string unset setParameter list error info rename\
931 tclExpr array anycap tclEval httpize tclMakeSafe}}
932 } else {
933 test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
934 enable_output uplevel dir http expr glob_match utime styleFooter encode64\
935 catch if tclReady searchable reinitialize combobox lindex query html\
936 anoncap randhex llength for set break regexp markdown styleHeader puts\
937 return checkout decorate artifact trace wiki proc hascap globalState\
938 continue getParameter hasfeature setting lsearch breakpoint upvar render\
939 repository string unset setParameter list error info rename array anycap\
940 httpize}}
941 }
942
943 ###############################################################################
944
945 fossil test-th-eval "info vars"
946
947 if {$th1Hooks} {
948 test th1-info-vars-1 {$RESULT eq \
949 "th_stack_trace cmd_flags tcl_platform cmd_name cmd_args"}
950 } else {
951 test th1-info-vars-1 {$RESULT eq "tcl_platform"}
952 }
953
954 ###############################################################################
955
956 fossil test-th-eval "set x 1; info vars"
957
958 if {$th1Hooks} {
959 test th1-info-vars-2 {$RESULT eq \
960 "x th_stack_trace cmd_flags tcl_platform cmd_name cmd_args"}
961 } else {
962 test th1-info-vars-2 {$RESULT eq "x tcl_platform"}
963 }
964
965 ###############################################################################
966
967 fossil test-th-eval "set x 1; unset x; info vars"
968
969 if {$th1Hooks} {
970 test th1-info-vars-3 {$RESULT eq \
971 "th_stack_trace cmd_flags tcl_platform cmd_name cmd_args"}
972 } else {
973 test th1-info-vars-3 {$RESULT eq "tcl_platform"}
974 }
975
976 ###############################################################################
@@ -981,14 +979,14 @@
981 ###############################################################################
982
983 fossil test-th-eval "set y 1; proc foo {} {set x 1; uplevel 1 {info vars}}; foo"
984
985 if {$th1Hooks} {
986 test th1-info-vars-5 {$RESULT eq \
987 "th_stack_trace y cmd_flags tcl_platform cmd_name cmd_args"}
988 } else {
989 test th1-info-vars-5 {$RESULT eq "y tcl_platform"}
990 }
991
992 ###############################################################################
993
994 fossil test-th-eval "array exists foo"
995
--- test/th1.test
+++ test/th1.test
@@ -913,64 +913,62 @@
913 test th1-reinitialize-2 {$RESULT ne ""}
914
915 ###############################################################################
916
917 #
918 # NOTE: This test will fail if the command names are added to TH1, or
919 # moved from Tcl builds to plain or the reverse. Sorting the
920 # command lists eliminates a dependence on order.
921 #
922 fossil test-th-eval "info commands"
923 set sorted_result [lsort $RESULT]
924 protOut "Sorted: $sorted_result"
925 set base_commands {anoncap anycap array artifact break breakpoint catch\
926 checkout combobox continue date decorate dir enable_output encode64\
927 error expr for getParameter glob_match globalState hascap hasfeature\
928 html htmlize http httpize if info insertCsrf lindex linecount list\
929 llength lsearch markdown proc puts query randhex redirect regexp\
930 reinitialize rename render repository return searchable set\
931 setParameter setting stime string styleFooter styleHeader tclReady\
932 trace unset uplevel upvar utime verifyCsrf wiki}
933 set tcl_commands {tclEval tclExpr tclInvoke tclIsSafe tclMakeSafe}
934 if {$th1Tcl} {
935 test th1-info-commands-1 {$sorted_result eq [lsort "$base_commands $tcl_commands"]}
 
 
 
 
 
 
 
936 } else {
937 test th1-info-commands-1 {$sorted_result eq [lsort "$base_commands"]}
938 }
939
 
 
 
 
 
 
940
941 ###############################################################################
942
943 fossil test-th-eval "info vars"
944
945 if {$th1Hooks} {
946 test th1-info-vars-1 {[lsort $RESULT] eq \
947 [lsort "th_stack_trace cmd_flags tcl_platform cmd_name cmd_args"]}
948 } else {
949 test th1-info-vars-1 {$RESULT eq "tcl_platform"}
950 }
951
952 ###############################################################################
953
954 fossil test-th-eval "set x 1; info vars"
955
956 if {$th1Hooks} {
957 test th1-info-vars-2 {[lsort $RESULT] eq \
958 [lsort "x th_stack_trace cmd_flags tcl_platform cmd_name cmd_args"]}
959 } else {
960 test th1-info-vars-2 {[lsort $RESULT] eq [lsort "x tcl_platform"]}
961 }
962
963 ###############################################################################
964
965 fossil test-th-eval "set x 1; unset x; info vars"
966
967 if {$th1Hooks} {
968 test th1-info-vars-3 {[lsort $RESULT] eq \
969 [lsort "th_stack_trace cmd_flags tcl_platform cmd_name cmd_args"]}
970 } else {
971 test th1-info-vars-3 {$RESULT eq "tcl_platform"}
972 }
973
974 ###############################################################################
@@ -981,14 +979,14 @@
979 ###############################################################################
980
981 fossil test-th-eval "set y 1; proc foo {} {set x 1; uplevel 1 {info vars}}; foo"
982
983 if {$th1Hooks} {
984 test th1-info-vars-5 {[lsort $RESULT] eq \
985 [lsort "th_stack_trace y cmd_flags tcl_platform cmd_name cmd_args"]}
986 } else {
987 test th1-info-vars-5 {[lsort $RESULT] eq [lsort "y tcl_platform"]}
988 }
989
990 ###############################################################################
991
992 fossil test-th-eval "array exists foo"
993

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button