Fossil SCM

Restore read-only TH1 tests to their original file. Coding style fixes in tests. Add 'dir' command to the expected command list test.

mistachkin 2015-08-15 18:47 ckol-th1-dir-cmd
Commit 25e9c00b8c6baf9bb6dc63965f2028be1c4cdee8
2 files changed +13 -128 +126 -22
+13 -128
--- test/th1-repo.test
+++ test/th1-repo.test
@@ -16,15 +16,14 @@
1616
#
1717
# Chris Drexler <[email protected]>
1818
#
1919
############################################################################
2020
#
21
-# TH1-repo commands
21
+# TH1 tests that may modify the repository
2222
#
2323
2424
catch {exec $::fossilexe info} res
25
-puts res=$res
2625
if {![regexp {use --repository} $res]} {
2726
puts stderr "Cannot run this test within an open checkout"
2827
return
2928
}
3029
@@ -32,24 +31,17 @@
3231
# Setup: Add Files and Commit #
3332
########################################
3433
3534
set rootDir [file normalize [pwd]]
3635
37
-set undoMsg "\n \"fossil undo\" is\
38
-available to undo changes to the\
39
-working checkout."
40
-
4136
repo_init
4237
4338
write_file f1.md "f1"
4439
write_file f2.md "f2"
4540
write_file f3.txt "f3"
4641
write_file f4.md "f4"
4742
48
-file mkdir [file join $rootDir test]
49
-write_file [file join $rootDir test th1.test] "th1.test"
50
-
5143
file mkdir [file join $rootDir subdirA]
5244
# NOTE: There are no files in subdirA.
5345
5446
file mkdir [file join $rootDir subdirB]
5547
write_file [file join $rootDir subdirB f5.md] "f5"
@@ -60,131 +52,24 @@
6052
6153
file mkdir [file join $rootDir subdirC]
6254
write_file [file join $rootDir subdirC f10.md] "f10"
6355
write_file [file join $rootDir subdirC f11t.xt] "f11"
6456
65
-
6657
set files_md [list subdirB/f5.md subdirB/f6.md subdirB/f8.md subdirC/f10.md]
6758
6859
fossil add $rootDir
6960
fossil commit -m "c1"
7061
7162
set dir [file dirname [info script]]
7263
73
-
74
-###############################################################################
75
-
76
-fossil test-th-eval "checkout 1"; # NOTE: Assumes running "in tree".
77
-test th1-checkout-1 {[string length $RESULT] > 0}
78
-
79
-###############################################################################
80
-
81
-fossil test-th-eval "checkout"; # NOTE: Assumes running "in tree".
82
-test th1-checkout-2 {[string length $RESULT] > 0}
83
-
84
-###############################################################################
85
-
86
-set savedPwd [pwd]; cd /
87
-fossil test-th-eval "checkout 1"
88
-cd $savedPwd; unset savedPwd
89
-test th1-checkout-3 {[string length $RESULT] == 0}
90
-
91
-###############################################################################
92
-
93
-set savedPwd [pwd]; cd /
94
-fossil test-th-eval "checkout"
95
-cd $savedPwd; unset savedPwd
96
-test th1-checkout-4 {[string length $RESULT] == 0}
97
-
98
-###############################################################################
99
-
100
-fossil test-th-eval "styleHeader {Page Title Here}"
101
-test th1-header-1 {$RESULT eq {TH_ERROR: repository unavailable}}
102
-
103
-###############################################################################
104
-
105
-fossil test-th-eval --open-config "styleHeader {Page Title Here}"
106
-test th1-header-2 {[regexp -- {<title>Unnamed Fossil Project: Page Title Here</title>} $RESULT]}
107
-
108
-###############################################################################
109
-
110
-fossil test-th-eval "styleFooter"
111
-test th1-footer-1 {$RESULT eq {TH_ERROR: repository unavailable}}
112
-
113
-###############################################################################
114
-
115
-fossil test-th-eval --open-config "styleFooter"
116
-test th1-footer-2 {$RESULT eq {}}
117
-
118
-###############################################################################
119
-
120
-fossil test-th-eval --open-config --cgi "styleHeader {}; styleFooter"
121
-test th1-footer-3 {[regexp -- {</body></html>} $RESULT]}
122
-
123
-###############################################################################
124
-
125
-fossil test-th-eval "artifact"
126
-test th1-artifact-1 {$RESULT eq \
127
- {TH_ERROR: wrong # args: should be "artifact ID ?FILENAME?"}}
128
-
129
-###############################################################################
130
-
131
-fossil test-th-eval "artifact tip"
132
-test th1-artifact-2 {$RESULT eq {TH_ERROR: repository unavailable}}
133
-
134
-###############################################################################
135
-
136
-fossil test-th-eval --open-config "artifact tip"
137
-test th1-artifact-3 {[regexp -- {F test/th1\.test [0-9a-f]{40}} $RESULT]}
138
-
139
-###############################################################################
140
-
141
-fossil test-th-eval "artifact 0000000000"
142
-test th1-artifact-4 {$RESULT eq {TH_ERROR: repository unavailable}}
143
-
144
-###############################################################################
145
-
146
-fossil test-th-eval --open-config "artifact 0000000000"
147
-test th1-artifact-5 {$RESULT eq {TH_ERROR: name not found}}
148
-
149
-###############################################################################
150
-
151
-fossil test-th-eval "artifact tip test/th1.test"
152
-test th1-artifact-6 {$RESULT eq {TH_ERROR: repository unavailable}}
153
-
154
-###############################################################################
155
-
156
-fossil test-th-eval --open-config "artifact tip test/th1.test"
157
-test th1-artifact-7 {[regexp -- {th1\.test} $RESULT]}
158
-
159
-###############################################################################
160
-
161
-fossil test-th-eval "artifact 0000000000 test/th1.test"
162
-test th1-artifact-8 {$RESULT eq {TH_ERROR: repository unavailable}}
163
-
164
-###############################################################################
165
-
166
-fossil test-th-eval --open-config "artifact 0000000000 test/th1.test"
167
-test th1-artifact-9 {$RESULT eq {TH_ERROR: manifest not found}}
168
-
169
-###############################################################################
170
-
171
-fossil test-th-eval "globalState checkout"
172
-test th1-globalState-repo-1 {[string length $RESULT] > 0}
173
-
174
-###############################################################################
175
-
176
-fossil test-th-eval "globalState repository"
177
-test th1-globalState-repo-2 {[string length $RESULT] > 0}
178
-
179
-
180
-###############################################################################
181
-
182
-fossil test-th-eval --open-config "dir trunk subdir*/*.md"
183
-set l [llength $RESULT ]
184
-test th1-dir-1 { $l eq [llength $files_md] }
185
-set n 1
186
-foreach i $RESULT j $files_md {
187
- test th1-dir-2-$n { $i eq $j }
188
- set n [expr $n + 1]
189
-}
190
-
64
+###############################################################################
65
+
66
+fossil test-th-eval --open-config "dir trunk subdir*/*.md"
67
+test th1-dir-1 {[llength $RESULT] eq [llength $files_md]}
68
+
69
+###############################################################################
70
+
71
+set n 1
72
+foreach i $RESULT j $files_md {
73
+ test th1-dir-2.$n {$i eq $j}
74
+ set n [expr {$n + 1}]
75
+}
19176
--- test/th1-repo.test
+++ test/th1-repo.test
@@ -16,15 +16,14 @@
16 #
17 # Chris Drexler <[email protected]>
18 #
19 ############################################################################
20 #
21 # TH1-repo commands
22 #
23
24 catch {exec $::fossilexe info} res
25 puts res=$res
26 if {![regexp {use --repository} $res]} {
27 puts stderr "Cannot run this test within an open checkout"
28 return
29 }
30
@@ -32,24 +31,17 @@
32 # Setup: Add Files and Commit #
33 ########################################
34
35 set rootDir [file normalize [pwd]]
36
37 set undoMsg "\n \"fossil undo\" is\
38 available to undo changes to the\
39 working checkout."
40
41 repo_init
42
43 write_file f1.md "f1"
44 write_file f2.md "f2"
45 write_file f3.txt "f3"
46 write_file f4.md "f4"
47
48 file mkdir [file join $rootDir test]
49 write_file [file join $rootDir test th1.test] "th1.test"
50
51 file mkdir [file join $rootDir subdirA]
52 # NOTE: There are no files in subdirA.
53
54 file mkdir [file join $rootDir subdirB]
55 write_file [file join $rootDir subdirB f5.md] "f5"
@@ -60,131 +52,24 @@
60
61 file mkdir [file join $rootDir subdirC]
62 write_file [file join $rootDir subdirC f10.md] "f10"
63 write_file [file join $rootDir subdirC f11t.xt] "f11"
64
65
66 set files_md [list subdirB/f5.md subdirB/f6.md subdirB/f8.md subdirC/f10.md]
67
68 fossil add $rootDir
69 fossil commit -m "c1"
70
71 set dir [file dirname [info script]]
72
73
74 ###############################################################################
75
76 fossil test-th-eval "checkout 1"; # NOTE: Assumes running "in tree".
77 test th1-checkout-1 {[string length $RESULT] > 0}
78
79 ###############################################################################
80
81 fossil test-th-eval "checkout"; # NOTE: Assumes running "in tree".
82 test th1-checkout-2 {[string length $RESULT] > 0}
83
84 ###############################################################################
85
86 set savedPwd [pwd]; cd /
87 fossil test-th-eval "checkout 1"
88 cd $savedPwd; unset savedPwd
89 test th1-checkout-3 {[string length $RESULT] == 0}
90
91 ###############################################################################
92
93 set savedPwd [pwd]; cd /
94 fossil test-th-eval "checkout"
95 cd $savedPwd; unset savedPwd
96 test th1-checkout-4 {[string length $RESULT] == 0}
97
98 ###############################################################################
99
100 fossil test-th-eval "styleHeader {Page Title Here}"
101 test th1-header-1 {$RESULT eq {TH_ERROR: repository unavailable}}
102
103 ###############################################################################
104
105 fossil test-th-eval --open-config "styleHeader {Page Title Here}"
106 test th1-header-2 {[regexp -- {<title>Unnamed Fossil Project: Page Title Here</title>} $RESULT]}
107
108 ###############################################################################
109
110 fossil test-th-eval "styleFooter"
111 test th1-footer-1 {$RESULT eq {TH_ERROR: repository unavailable}}
112
113 ###############################################################################
114
115 fossil test-th-eval --open-config "styleFooter"
116 test th1-footer-2 {$RESULT eq {}}
117
118 ###############################################################################
119
120 fossil test-th-eval --open-config --cgi "styleHeader {}; styleFooter"
121 test th1-footer-3 {[regexp -- {</body></html>} $RESULT]}
122
123 ###############################################################################
124
125 fossil test-th-eval "artifact"
126 test th1-artifact-1 {$RESULT eq \
127 {TH_ERROR: wrong # args: should be "artifact ID ?FILENAME?"}}
128
129 ###############################################################################
130
131 fossil test-th-eval "artifact tip"
132 test th1-artifact-2 {$RESULT eq {TH_ERROR: repository unavailable}}
133
134 ###############################################################################
135
136 fossil test-th-eval --open-config "artifact tip"
137 test th1-artifact-3 {[regexp -- {F test/th1\.test [0-9a-f]{40}} $RESULT]}
138
139 ###############################################################################
140
141 fossil test-th-eval "artifact 0000000000"
142 test th1-artifact-4 {$RESULT eq {TH_ERROR: repository unavailable}}
143
144 ###############################################################################
145
146 fossil test-th-eval --open-config "artifact 0000000000"
147 test th1-artifact-5 {$RESULT eq {TH_ERROR: name not found}}
148
149 ###############################################################################
150
151 fossil test-th-eval "artifact tip test/th1.test"
152 test th1-artifact-6 {$RESULT eq {TH_ERROR: repository unavailable}}
153
154 ###############################################################################
155
156 fossil test-th-eval --open-config "artifact tip test/th1.test"
157 test th1-artifact-7 {[regexp -- {th1\.test} $RESULT]}
158
159 ###############################################################################
160
161 fossil test-th-eval "artifact 0000000000 test/th1.test"
162 test th1-artifact-8 {$RESULT eq {TH_ERROR: repository unavailable}}
163
164 ###############################################################################
165
166 fossil test-th-eval --open-config "artifact 0000000000 test/th1.test"
167 test th1-artifact-9 {$RESULT eq {TH_ERROR: manifest not found}}
168
169 ###############################################################################
170
171 fossil test-th-eval "globalState checkout"
172 test th1-globalState-repo-1 {[string length $RESULT] > 0}
173
174 ###############################################################################
175
176 fossil test-th-eval "globalState repository"
177 test th1-globalState-repo-2 {[string length $RESULT] > 0}
178
179
180 ###############################################################################
181
182 fossil test-th-eval --open-config "dir trunk subdir*/*.md"
183 set l [llength $RESULT ]
184 test th1-dir-1 { $l eq [llength $files_md] }
185 set n 1
186 foreach i $RESULT j $files_md {
187 test th1-dir-2-$n { $i eq $j }
188 set n [expr $n + 1]
189 }
190
191
--- test/th1-repo.test
+++ test/th1-repo.test
@@ -16,15 +16,14 @@
16 #
17 # Chris Drexler <[email protected]>
18 #
19 ############################################################################
20 #
21 # TH1 tests that may modify the repository
22 #
23
24 catch {exec $::fossilexe info} res
 
25 if {![regexp {use --repository} $res]} {
26 puts stderr "Cannot run this test within an open checkout"
27 return
28 }
29
@@ -32,24 +31,17 @@
31 # Setup: Add Files and Commit #
32 ########################################
33
34 set rootDir [file normalize [pwd]]
35
 
 
 
 
36 repo_init
37
38 write_file f1.md "f1"
39 write_file f2.md "f2"
40 write_file f3.txt "f3"
41 write_file f4.md "f4"
42
 
 
 
43 file mkdir [file join $rootDir subdirA]
44 # NOTE: There are no files in subdirA.
45
46 file mkdir [file join $rootDir subdirB]
47 write_file [file join $rootDir subdirB f5.md] "f5"
@@ -60,131 +52,24 @@
52
53 file mkdir [file join $rootDir subdirC]
54 write_file [file join $rootDir subdirC f10.md] "f10"
55 write_file [file join $rootDir subdirC f11t.xt] "f11"
56
 
57 set files_md [list subdirB/f5.md subdirB/f6.md subdirB/f8.md subdirC/f10.md]
58
59 fossil add $rootDir
60 fossil commit -m "c1"
61
62 set dir [file dirname [info script]]
63
64 ###############################################################################
65
66 fossil test-th-eval --open-config "dir trunk subdir*/*.md"
67 test th1-dir-1 {[llength $RESULT] eq [llength $files_md]}
68
69 ###############################################################################
70
71 set n 1
72 foreach i $RESULT j $files_md {
73 test th1-dir-2.$n {$i eq $j}
74 set n [expr {$n + 1}]
75 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
+126 -22
--- test/th1.test
+++ test/th1.test
@@ -552,10 +552,33 @@
552552
###############################################################################
553553
554554
fossil test-th-eval "lindex list -0x"
555555
test th1-expr-49 {$RESULT eq {TH_ERROR: expected integer, got: "-0x"}}
556556
557
+###############################################################################
558
+
559
+fossil test-th-eval "checkout 1"; # NOTE: Assumes running "in tree".
560
+test th1-checkout-1 {[string length $RESULT] > 0}
561
+
562
+###############################################################################
563
+
564
+fossil test-th-eval "checkout"; # NOTE: Assumes running "in tree".
565
+test th1-checkout-2 {[string length $RESULT] > 0}
566
+
567
+###############################################################################
568
+
569
+set savedPwd [pwd]; cd /
570
+fossil test-th-eval "checkout 1"
571
+cd $savedPwd; unset savedPwd
572
+test th1-checkout-3 {[string length $RESULT] == 0}
573
+
574
+###############################################################################
575
+
576
+set savedPwd [pwd]; cd /
577
+fossil test-th-eval "checkout"
578
+cd $savedPwd; unset savedPwd
579
+test th1-checkout-4 {[string length $RESULT] == 0}
557580
558581
###############################################################################
559582
560583
fossil test-th-eval "render {}"
561584
test th1-render-1 {$RESULT eq {}}
@@ -611,10 +634,35 @@
611634
------------------- END TRACE LOG -------------------}}
612635
}
613636
614637
###############################################################################
615638
639
+fossil test-th-eval "styleHeader {Page Title Here}"
640
+test th1-header-1 {$RESULT eq {TH_ERROR: repository unavailable}}
641
+
642
+###############################################################################
643
+
644
+fossil test-th-eval --open-config "styleHeader {Page Title Here}"
645
+test th1-header-2 {[regexp -- {<title>Fossil: Page Title Here</title>} $RESULT]}
646
+
647
+###############################################################################
648
+
649
+fossil test-th-eval "styleFooter"
650
+test th1-footer-1 {$RESULT eq {TH_ERROR: repository unavailable}}
651
+
652
+###############################################################################
653
+
654
+fossil test-th-eval --open-config "styleFooter"
655
+test th1-footer-2 {$RESULT eq {}}
656
+
657
+###############################################################################
658
+
659
+fossil test-th-eval --open-config --cgi "styleHeader {}; styleFooter"
660
+test th1-footer-3 {[regexp -- {</body></html>} $RESULT]}
661
+
662
+###############################################################################
663
+
616664
fossil test-th-eval "getParameter"
617665
test th1-get-parameter-1 {$RESULT eq \
618666
{TH_ERROR: wrong # args: should be "getParameter NAME ?DEFAULT?"}}
619667
620668
###############################################################################
@@ -663,67 +711,123 @@
663711
fossil test-th-eval "setParameter test4 value4; setParameter test4 value5; getParameter test4 defValue4"
664712
test th1-set-parameter-7 {$RESULT eq {value5}}
665713
666714
###############################################################################
667715
716
+fossil test-th-eval "artifact"
717
+test th1-artifact-1 {$RESULT eq \
718
+ {TH_ERROR: wrong # args: should be "artifact ID ?FILENAME?"}}
719
+
720
+###############################################################################
721
+
722
+fossil test-th-eval "artifact tip"
723
+test th1-artifact-2 {$RESULT eq {TH_ERROR: repository unavailable}}
724
+
725
+###############################################################################
726
+
727
+fossil test-th-eval --open-config "artifact tip"
728
+test th1-artifact-3 {[regexp -- {F test/th1\.test [0-9a-f]{40}} $RESULT]}
729
+
730
+###############################################################################
731
+
732
+fossil test-th-eval "artifact 0000000000"
733
+test th1-artifact-4 {$RESULT eq {TH_ERROR: repository unavailable}}
734
+
735
+###############################################################################
736
+
737
+fossil test-th-eval --open-config "artifact 0000000000"
738
+test th1-artifact-5 {$RESULT eq {TH_ERROR: name not found}}
739
+
740
+###############################################################################
741
+
742
+fossil test-th-eval "artifact tip test/th1.test"
743
+test th1-artifact-6 {$RESULT eq {TH_ERROR: repository unavailable}}
744
+
745
+###############################################################################
746
+
747
+fossil test-th-eval --open-config "artifact tip test/th1.test"
748
+test th1-artifact-7 {[regexp -- {th1-artifact-7} $RESULT]}
749
+
750
+###############################################################################
751
+
752
+fossil test-th-eval "artifact 0000000000 test/th1.test"
753
+test th1-artifact-8 {$RESULT eq {TH_ERROR: repository unavailable}}
754
+
755
+###############################################################################
756
+
757
+fossil test-th-eval --open-config "artifact 0000000000 test/th1.test"
758
+test th1-artifact-9 {$RESULT eq {TH_ERROR: manifest not found}}
759
+
760
+###############################################################################
761
+
762
+fossil test-th-eval "globalState checkout"
763
+test th1-globalState-1 {[string length $RESULT] > 0}
764
+
765
+###############################################################################
766
+
668767
fossil test-th-eval "globalState checkout"
669
-test th1-globalState-1 {$RESULT eq [fossil test-th-eval checkout]}
768
+test th1-globalState-2 {$RESULT eq [fossil test-th-eval checkout]}
670769
671770
###############################################################################
672771
673772
fossil test-th-eval "globalState configuration"
674
-test th1-globalState-2 {[string length $RESULT] == 0}
773
+test th1-globalState-3 {[string length $RESULT] == 0}
675774
676775
###############################################################################
677776
678777
fossil test-th-eval --open-config "globalState configuration"
679
-test th1-globalState-3 {[string length $RESULT] > 0}
778
+test th1-globalState-4 {[string length $RESULT] > 0}
680779
681780
###############################################################################
682781
683782
fossil test-th-eval "globalState executable"
684
-test th1-globalState-4 {[file rootname [file tail $RESULT]] eq "fossil"}
783
+test th1-globalState-5 {[file rootname [file tail $RESULT]] eq "fossil"}
685784
686785
###############################################################################
687786
688787
fossil test-th-eval "globalState log"
689
-test th1-globalState-5 {[string length $RESULT] == 0}
788
+test th1-globalState-6 {[string length $RESULT] == 0}
690789
691790
###############################################################################
692791
693792
fossil test-th-eval --errorlog foserrors.log "globalState log"
694
-test th1-globalState-6 {$RESULT eq "foserrors.log"}
793
+test th1-globalState-7 {$RESULT eq "foserrors.log"}
794
+
795
+###############################################################################
796
+
797
+fossil test-th-eval "globalState repository"
798
+test th1-globalState-8 {[string length $RESULT] > 0}
695799
696800
###############################################################################
697801
698802
fossil test-th-eval "globalState repository"
699
-test th1-globalState-7 {$RESULT eq [fossil test-th-eval repository]}
803
+test th1-globalState-9 {$RESULT eq [fossil test-th-eval repository]}
700804
701805
###############################################################################
702806
703807
fossil test-th-eval "globalState top"
704
-test th1-globalState-8 {[string length $RESULT] == 0}
808
+test th1-globalState-10 {[string length $RESULT] == 0}
705809
706810
###############################################################################
707811
708812
fossil test-th-eval "globalState user"
709
-test th1-globalState-9 {[string length $RESULT] == 0}
813
+test th1-globalState-11 {[string length $RESULT] == 0}
710814
711815
###############################################################################
712816
713817
fossil test-th-eval --user fossil-th1-test "globalState user"
714
-test th1-globalState-10 {$RESULT eq "fossil-th1-test"}
818
+test th1-globalState-12 {$RESULT eq "fossil-th1-test"}
715819
716820
###############################################################################
717821
718822
fossil test-th-eval "globalState vfs"
719
-test th1-globalState-11 {[string length $RESULT] == 0}
823
+test th1-globalState-13 {[string length $RESULT] == 0}
720824
721825
###############################################################################
722826
723827
fossil test-th-eval "globalState vfs"
724
-test th1-globalState-12 {[string length $RESULT] == 0}
828
+test th1-globalState-14 {[string length $RESULT] == 0}
725829
726830
###############################################################################
727831
728832
if {$tcl_platform(platform) eq "windows"} then {
729833
set altVfs win32-longpath
@@ -732,16 +836,16 @@
732836
}
733837
734838
###############################################################################
735839
736840
fossil test-th-eval --vfs $altVfs "globalState vfs"
737
-test th1-globalState-13 {$RESULT eq $altVfs}
841
+test th1-globalState-15 {$RESULT eq $altVfs}
738842
739843
###############################################################################
740844
741845
fossil test-th-eval "globalState flags"
742
-test th1-globalState-14 {$RESULT eq "0"}
846
+test th1-globalState-16 {$RESULT eq "0"}
743847
744848
###############################################################################
745849
746850
fossil test-th-eval "reinitialize; globalState configuration"
747851
test th1-reinitialize-1 {$RESULT eq ""}
@@ -755,18 +859,18 @@
755859
756860
#
757861
# NOTE: This test may fail if the command names do not always come
758862
# out in a deterministic order from TH1.
759863
#
760
-#fossil test-th-eval "info commands"
761
-#test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
762
-#enable_output uplevel http expr glob_match utime styleFooter catch if\
763
-#tclReady searchable reinitialize combobox lindex query html anoncap randhex\
764
-#llength for set break regexp markdown styleHeader puts return checkout\
765
-#decorate artifact trace wiki proc hascap globalState continue getParameter\
766
-#hasfeature setting lsearch breakpoint upvar render repository string unset\
767
-#setParameter list error info rename anycap httpize}}
864
+fossil test-th-eval "info commands"
865
+test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
866
+enable_output uplevel dir http expr glob_match utime styleFooter catch if\
867
+tclReady searchable reinitialize combobox lindex query html anoncap randhex\
868
+llength for set break regexp markdown styleHeader puts return checkout\
869
+decorate artifact trace wiki proc hascap globalState continue getParameter\
870
+hasfeature setting lsearch breakpoint upvar render repository string unset\
871
+setParameter list error info rename anycap httpize}}
768872
769873
###############################################################################
770874
771875
fossil test-th-eval "info vars"
772876
test th1-info-vars-1 {$RESULT eq ""}
773877
--- test/th1.test
+++ test/th1.test
@@ -552,10 +552,33 @@
552 ###############################################################################
553
554 fossil test-th-eval "lindex list -0x"
555 test th1-expr-49 {$RESULT eq {TH_ERROR: expected integer, got: "-0x"}}
556
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
557
558 ###############################################################################
559
560 fossil test-th-eval "render {}"
561 test th1-render-1 {$RESULT eq {}}
@@ -611,10 +634,35 @@
611 ------------------- END TRACE LOG -------------------}}
612 }
613
614 ###############################################################################
615
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
616 fossil test-th-eval "getParameter"
617 test th1-get-parameter-1 {$RESULT eq \
618 {TH_ERROR: wrong # args: should be "getParameter NAME ?DEFAULT?"}}
619
620 ###############################################################################
@@ -663,67 +711,123 @@
663 fossil test-th-eval "setParameter test4 value4; setParameter test4 value5; getParameter test4 defValue4"
664 test th1-set-parameter-7 {$RESULT eq {value5}}
665
666 ###############################################################################
667
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
668 fossil test-th-eval "globalState checkout"
669 test th1-globalState-1 {$RESULT eq [fossil test-th-eval checkout]}
670
671 ###############################################################################
672
673 fossil test-th-eval "globalState configuration"
674 test th1-globalState-2 {[string length $RESULT] == 0}
675
676 ###############################################################################
677
678 fossil test-th-eval --open-config "globalState configuration"
679 test th1-globalState-3 {[string length $RESULT] > 0}
680
681 ###############################################################################
682
683 fossil test-th-eval "globalState executable"
684 test th1-globalState-4 {[file rootname [file tail $RESULT]] eq "fossil"}
685
686 ###############################################################################
687
688 fossil test-th-eval "globalState log"
689 test th1-globalState-5 {[string length $RESULT] == 0}
690
691 ###############################################################################
692
693 fossil test-th-eval --errorlog foserrors.log "globalState log"
694 test th1-globalState-6 {$RESULT eq "foserrors.log"}
 
 
 
 
 
695
696 ###############################################################################
697
698 fossil test-th-eval "globalState repository"
699 test th1-globalState-7 {$RESULT eq [fossil test-th-eval repository]}
700
701 ###############################################################################
702
703 fossil test-th-eval "globalState top"
704 test th1-globalState-8 {[string length $RESULT] == 0}
705
706 ###############################################################################
707
708 fossil test-th-eval "globalState user"
709 test th1-globalState-9 {[string length $RESULT] == 0}
710
711 ###############################################################################
712
713 fossil test-th-eval --user fossil-th1-test "globalState user"
714 test th1-globalState-10 {$RESULT eq "fossil-th1-test"}
715
716 ###############################################################################
717
718 fossil test-th-eval "globalState vfs"
719 test th1-globalState-11 {[string length $RESULT] == 0}
720
721 ###############################################################################
722
723 fossil test-th-eval "globalState vfs"
724 test th1-globalState-12 {[string length $RESULT] == 0}
725
726 ###############################################################################
727
728 if {$tcl_platform(platform) eq "windows"} then {
729 set altVfs win32-longpath
@@ -732,16 +836,16 @@
732 }
733
734 ###############################################################################
735
736 fossil test-th-eval --vfs $altVfs "globalState vfs"
737 test th1-globalState-13 {$RESULT eq $altVfs}
738
739 ###############################################################################
740
741 fossil test-th-eval "globalState flags"
742 test th1-globalState-14 {$RESULT eq "0"}
743
744 ###############################################################################
745
746 fossil test-th-eval "reinitialize; globalState configuration"
747 test th1-reinitialize-1 {$RESULT eq ""}
@@ -755,18 +859,18 @@
755
756 #
757 # NOTE: This test may fail if the command names do not always come
758 # out in a deterministic order from TH1.
759 #
760 #fossil test-th-eval "info commands"
761 #test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
762 #enable_output uplevel http expr glob_match utime styleFooter catch if\
763 #tclReady searchable reinitialize combobox lindex query html anoncap randhex\
764 #llength for set break regexp markdown styleHeader puts return checkout\
765 #decorate artifact trace wiki proc hascap globalState continue getParameter\
766 #hasfeature setting lsearch breakpoint upvar render repository string unset\
767 #setParameter list error info rename anycap httpize}}
768
769 ###############################################################################
770
771 fossil test-th-eval "info vars"
772 test th1-info-vars-1 {$RESULT eq ""}
773
--- test/th1.test
+++ test/th1.test
@@ -552,10 +552,33 @@
552 ###############################################################################
553
554 fossil test-th-eval "lindex list -0x"
555 test th1-expr-49 {$RESULT eq {TH_ERROR: expected integer, got: "-0x"}}
556
557 ###############################################################################
558
559 fossil test-th-eval "checkout 1"; # NOTE: Assumes running "in tree".
560 test th1-checkout-1 {[string length $RESULT] > 0}
561
562 ###############################################################################
563
564 fossil test-th-eval "checkout"; # NOTE: Assumes running "in tree".
565 test th1-checkout-2 {[string length $RESULT] > 0}
566
567 ###############################################################################
568
569 set savedPwd [pwd]; cd /
570 fossil test-th-eval "checkout 1"
571 cd $savedPwd; unset savedPwd
572 test th1-checkout-3 {[string length $RESULT] == 0}
573
574 ###############################################################################
575
576 set savedPwd [pwd]; cd /
577 fossil test-th-eval "checkout"
578 cd $savedPwd; unset savedPwd
579 test th1-checkout-4 {[string length $RESULT] == 0}
580
581 ###############################################################################
582
583 fossil test-th-eval "render {}"
584 test th1-render-1 {$RESULT eq {}}
@@ -611,10 +634,35 @@
634 ------------------- END TRACE LOG -------------------}}
635 }
636
637 ###############################################################################
638
639 fossil test-th-eval "styleHeader {Page Title Here}"
640 test th1-header-1 {$RESULT eq {TH_ERROR: repository unavailable}}
641
642 ###############################################################################
643
644 fossil test-th-eval --open-config "styleHeader {Page Title Here}"
645 test th1-header-2 {[regexp -- {<title>Fossil: Page Title Here</title>} $RESULT]}
646
647 ###############################################################################
648
649 fossil test-th-eval "styleFooter"
650 test th1-footer-1 {$RESULT eq {TH_ERROR: repository unavailable}}
651
652 ###############################################################################
653
654 fossil test-th-eval --open-config "styleFooter"
655 test th1-footer-2 {$RESULT eq {}}
656
657 ###############################################################################
658
659 fossil test-th-eval --open-config --cgi "styleHeader {}; styleFooter"
660 test th1-footer-3 {[regexp -- {</body></html>} $RESULT]}
661
662 ###############################################################################
663
664 fossil test-th-eval "getParameter"
665 test th1-get-parameter-1 {$RESULT eq \
666 {TH_ERROR: wrong # args: should be "getParameter NAME ?DEFAULT?"}}
667
668 ###############################################################################
@@ -663,67 +711,123 @@
711 fossil test-th-eval "setParameter test4 value4; setParameter test4 value5; getParameter test4 defValue4"
712 test th1-set-parameter-7 {$RESULT eq {value5}}
713
714 ###############################################################################
715
716 fossil test-th-eval "artifact"
717 test th1-artifact-1 {$RESULT eq \
718 {TH_ERROR: wrong # args: should be "artifact ID ?FILENAME?"}}
719
720 ###############################################################################
721
722 fossil test-th-eval "artifact tip"
723 test th1-artifact-2 {$RESULT eq {TH_ERROR: repository unavailable}}
724
725 ###############################################################################
726
727 fossil test-th-eval --open-config "artifact tip"
728 test th1-artifact-3 {[regexp -- {F test/th1\.test [0-9a-f]{40}} $RESULT]}
729
730 ###############################################################################
731
732 fossil test-th-eval "artifact 0000000000"
733 test th1-artifact-4 {$RESULT eq {TH_ERROR: repository unavailable}}
734
735 ###############################################################################
736
737 fossil test-th-eval --open-config "artifact 0000000000"
738 test th1-artifact-5 {$RESULT eq {TH_ERROR: name not found}}
739
740 ###############################################################################
741
742 fossil test-th-eval "artifact tip test/th1.test"
743 test th1-artifact-6 {$RESULT eq {TH_ERROR: repository unavailable}}
744
745 ###############################################################################
746
747 fossil test-th-eval --open-config "artifact tip test/th1.test"
748 test th1-artifact-7 {[regexp -- {th1-artifact-7} $RESULT]}
749
750 ###############################################################################
751
752 fossil test-th-eval "artifact 0000000000 test/th1.test"
753 test th1-artifact-8 {$RESULT eq {TH_ERROR: repository unavailable}}
754
755 ###############################################################################
756
757 fossil test-th-eval --open-config "artifact 0000000000 test/th1.test"
758 test th1-artifact-9 {$RESULT eq {TH_ERROR: manifest not found}}
759
760 ###############################################################################
761
762 fossil test-th-eval "globalState checkout"
763 test th1-globalState-1 {[string length $RESULT] > 0}
764
765 ###############################################################################
766
767 fossil test-th-eval "globalState checkout"
768 test th1-globalState-2 {$RESULT eq [fossil test-th-eval checkout]}
769
770 ###############################################################################
771
772 fossil test-th-eval "globalState configuration"
773 test th1-globalState-3 {[string length $RESULT] == 0}
774
775 ###############################################################################
776
777 fossil test-th-eval --open-config "globalState configuration"
778 test th1-globalState-4 {[string length $RESULT] > 0}
779
780 ###############################################################################
781
782 fossil test-th-eval "globalState executable"
783 test th1-globalState-5 {[file rootname [file tail $RESULT]] eq "fossil"}
784
785 ###############################################################################
786
787 fossil test-th-eval "globalState log"
788 test th1-globalState-6 {[string length $RESULT] == 0}
789
790 ###############################################################################
791
792 fossil test-th-eval --errorlog foserrors.log "globalState log"
793 test th1-globalState-7 {$RESULT eq "foserrors.log"}
794
795 ###############################################################################
796
797 fossil test-th-eval "globalState repository"
798 test th1-globalState-8 {[string length $RESULT] > 0}
799
800 ###############################################################################
801
802 fossil test-th-eval "globalState repository"
803 test th1-globalState-9 {$RESULT eq [fossil test-th-eval repository]}
804
805 ###############################################################################
806
807 fossil test-th-eval "globalState top"
808 test th1-globalState-10 {[string length $RESULT] == 0}
809
810 ###############################################################################
811
812 fossil test-th-eval "globalState user"
813 test th1-globalState-11 {[string length $RESULT] == 0}
814
815 ###############################################################################
816
817 fossil test-th-eval --user fossil-th1-test "globalState user"
818 test th1-globalState-12 {$RESULT eq "fossil-th1-test"}
819
820 ###############################################################################
821
822 fossil test-th-eval "globalState vfs"
823 test th1-globalState-13 {[string length $RESULT] == 0}
824
825 ###############################################################################
826
827 fossil test-th-eval "globalState vfs"
828 test th1-globalState-14 {[string length $RESULT] == 0}
829
830 ###############################################################################
831
832 if {$tcl_platform(platform) eq "windows"} then {
833 set altVfs win32-longpath
@@ -732,16 +836,16 @@
836 }
837
838 ###############################################################################
839
840 fossil test-th-eval --vfs $altVfs "globalState vfs"
841 test th1-globalState-15 {$RESULT eq $altVfs}
842
843 ###############################################################################
844
845 fossil test-th-eval "globalState flags"
846 test th1-globalState-16 {$RESULT eq "0"}
847
848 ###############################################################################
849
850 fossil test-th-eval "reinitialize; globalState configuration"
851 test th1-reinitialize-1 {$RESULT eq ""}
@@ -755,18 +859,18 @@
859
860 #
861 # NOTE: This test may fail if the command names do not always come
862 # out in a deterministic order from TH1.
863 #
864 fossil test-th-eval "info commands"
865 test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
866 enable_output uplevel dir http expr glob_match utime styleFooter catch if\
867 tclReady searchable reinitialize combobox lindex query html anoncap randhex\
868 llength for set break regexp markdown styleHeader puts return checkout\
869 decorate artifact trace wiki proc hascap globalState continue getParameter\
870 hasfeature setting lsearch breakpoint upvar render repository string unset\
871 setParameter list error info rename anycap httpize}}
872
873 ###############################################################################
874
875 fossil test-th-eval "info vars"
876 test th1-info-vars-1 {$RESULT eq ""}
877

Keyboard Shortcuts

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