Fossil SCM

Fix some TH1 test failures due to recent changes.

mistachkin 2015-02-16 03:11 trunk
Commit d44207ff43b0aaa3eb5f0fa0e440c3481b57ce4b
3 files changed +73 -3 +10 -10 +21 -21
+73 -3
--- src/th_main.c
+++ src/th_main.c
@@ -246,10 +246,81 @@
246246
sendText("ERROR: ", -1, 0);
247247
sendText((char*)z, n, 1);
248248
sendText(forceCgi || g.cgiOutput ? "</p>" : "\n", -1, 0);
249249
enableOutput = savedEnable;
250250
}
251
+
252
+/*
253
+** Convert name to an rid. This function was copied from name_to_typed_rid()
254
+** in name.c; however, it has been modified to report TH1 script errors instead
255
+** of "fatal errors".
256
+*/
257
+int th1_name_to_typed_rid(
258
+ Th_Interp *interp,
259
+ const char *zName,
260
+ const char *zType
261
+){
262
+ int rid;
263
+
264
+ if( zName==0 || zName[0]==0 ) return 0;
265
+ rid = symbolic_name_to_rid(zName, zType);
266
+ if( rid<0 ){
267
+ Th_SetResult(interp, "ambiguous name", -1);
268
+ }else if( rid==0 ){
269
+ Th_SetResult(interp, "name not found", -1);
270
+ }
271
+ return rid;
272
+}
273
+
274
+/*
275
+** Attempt to lookup the specified checkin and file name into an rid.
276
+** This function was copied from artifact_from_ci_and_filename() in
277
+** info.c; however, it has been modified to report TH1 script errors
278
+** instead of "fatal errors".
279
+*/
280
+int th1_artifact_from_ci_and_filename(
281
+ Th_Interp *interp,
282
+ const char *zCI,
283
+ const char *zFilename
284
+){
285
+ int cirid;
286
+ Blob err;
287
+ Manifest *pManifest;
288
+ ManifestFile *pFile;
289
+
290
+ if( zCI==0 ){
291
+ Th_SetResult(interp, "invalid check-in", -1);
292
+ return 0;
293
+ }
294
+ if( zFilename==0 ){
295
+ Th_SetResult(interp, "invalid file name", -1);
296
+ return 0;
297
+ }
298
+ cirid = th1_name_to_typed_rid(interp, zCI, "*");
299
+ blob_zero(&err);
300
+ pManifest = manifest_get(cirid, CFTYPE_MANIFEST, &err);
301
+ if( pManifest==0 ){
302
+ if( blob_size(&err)>0 ){
303
+ Th_SetResult(interp, blob_str(&err), blob_size(&err));
304
+ }else{
305
+ Th_SetResult(interp, "manifest not found", -1);
306
+ }
307
+ blob_reset(&err);
308
+ return 0;
309
+ }
310
+ blob_reset(&err);
311
+ manifest_file_rewind(pManifest);
312
+ while( (pFile = manifest_file_next(pManifest,0))!=0 ){
313
+ if( fossil_strcmp(zFilename, pFile->zName)==0 ){
314
+ int rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q", pFile->zUuid);
315
+ manifest_destroy(pManifest);
316
+ return rid;
317
+ }
318
+ }
319
+ Th_SetResult(interp, "file name not found in manifest", -1);
320
+ return 0;
321
+}
251322
252323
/*
253324
** TH1 command: puts STRING
254325
** TH1 command: html STRING
255326
**
@@ -981,20 +1052,19 @@
9811052
}
9821053
if( Th_IsRepositoryOpen() ){
9831054
int rid;
9841055
Blob content;
9851056
if( argc==3 ){
986
- rid = artifact_from_ci_and_filename(argv[1], argv[2]);
1057
+ rid = th1_artifact_from_ci_and_filename(interp, argv[1], argv[2]);
9871058
}else{
988
- rid = name_to_rid(argv[1]);
1059
+ rid = th1_name_to_typed_rid(interp, argv[1], "*");
9891060
}
9901061
if( rid!=0 && content_get(rid, &content) ){
9911062
Th_SetResult(interp, blob_str(&content), blob_size(&content));
9921063
blob_reset(&content);
9931064
return TH_OK;
9941065
}else{
995
- Th_SetResult(interp, "artifact not found", -1);
9961066
return TH_ERROR;
9971067
}
9981068
}else{
9991069
Th_SetResult(interp, "repository unavailable", -1);
10001070
return TH_ERROR;
10011071
--- src/th_main.c
+++ src/th_main.c
@@ -246,10 +246,81 @@
246 sendText("ERROR: ", -1, 0);
247 sendText((char*)z, n, 1);
248 sendText(forceCgi || g.cgiOutput ? "</p>" : "\n", -1, 0);
249 enableOutput = savedEnable;
250 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
252 /*
253 ** TH1 command: puts STRING
254 ** TH1 command: html STRING
255 **
@@ -981,20 +1052,19 @@
981 }
982 if( Th_IsRepositoryOpen() ){
983 int rid;
984 Blob content;
985 if( argc==3 ){
986 rid = artifact_from_ci_and_filename(argv[1], argv[2]);
987 }else{
988 rid = name_to_rid(argv[1]);
989 }
990 if( rid!=0 && content_get(rid, &content) ){
991 Th_SetResult(interp, blob_str(&content), blob_size(&content));
992 blob_reset(&content);
993 return TH_OK;
994 }else{
995 Th_SetResult(interp, "artifact not found", -1);
996 return TH_ERROR;
997 }
998 }else{
999 Th_SetResult(interp, "repository unavailable", -1);
1000 return TH_ERROR;
1001
--- src/th_main.c
+++ src/th_main.c
@@ -246,10 +246,81 @@
246 sendText("ERROR: ", -1, 0);
247 sendText((char*)z, n, 1);
248 sendText(forceCgi || g.cgiOutput ? "</p>" : "\n", -1, 0);
249 enableOutput = savedEnable;
250 }
251
252 /*
253 ** Convert name to an rid. This function was copied from name_to_typed_rid()
254 ** in name.c; however, it has been modified to report TH1 script errors instead
255 ** of "fatal errors".
256 */
257 int th1_name_to_typed_rid(
258 Th_Interp *interp,
259 const char *zName,
260 const char *zType
261 ){
262 int rid;
263
264 if( zName==0 || zName[0]==0 ) return 0;
265 rid = symbolic_name_to_rid(zName, zType);
266 if( rid<0 ){
267 Th_SetResult(interp, "ambiguous name", -1);
268 }else if( rid==0 ){
269 Th_SetResult(interp, "name not found", -1);
270 }
271 return rid;
272 }
273
274 /*
275 ** Attempt to lookup the specified checkin and file name into an rid.
276 ** This function was copied from artifact_from_ci_and_filename() in
277 ** info.c; however, it has been modified to report TH1 script errors
278 ** instead of "fatal errors".
279 */
280 int th1_artifact_from_ci_and_filename(
281 Th_Interp *interp,
282 const char *zCI,
283 const char *zFilename
284 ){
285 int cirid;
286 Blob err;
287 Manifest *pManifest;
288 ManifestFile *pFile;
289
290 if( zCI==0 ){
291 Th_SetResult(interp, "invalid check-in", -1);
292 return 0;
293 }
294 if( zFilename==0 ){
295 Th_SetResult(interp, "invalid file name", -1);
296 return 0;
297 }
298 cirid = th1_name_to_typed_rid(interp, zCI, "*");
299 blob_zero(&err);
300 pManifest = manifest_get(cirid, CFTYPE_MANIFEST, &err);
301 if( pManifest==0 ){
302 if( blob_size(&err)>0 ){
303 Th_SetResult(interp, blob_str(&err), blob_size(&err));
304 }else{
305 Th_SetResult(interp, "manifest not found", -1);
306 }
307 blob_reset(&err);
308 return 0;
309 }
310 blob_reset(&err);
311 manifest_file_rewind(pManifest);
312 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
313 if( fossil_strcmp(zFilename, pFile->zName)==0 ){
314 int rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q", pFile->zUuid);
315 manifest_destroy(pManifest);
316 return rid;
317 }
318 }
319 Th_SetResult(interp, "file name not found in manifest", -1);
320 return 0;
321 }
322
323 /*
324 ** TH1 command: puts STRING
325 ** TH1 command: html STRING
326 **
@@ -981,20 +1052,19 @@
1052 }
1053 if( Th_IsRepositoryOpen() ){
1054 int rid;
1055 Blob content;
1056 if( argc==3 ){
1057 rid = th1_artifact_from_ci_and_filename(interp, argv[1], argv[2]);
1058 }else{
1059 rid = th1_name_to_typed_rid(interp, argv[1], "*");
1060 }
1061 if( rid!=0 && content_get(rid, &content) ){
1062 Th_SetResult(interp, blob_str(&content), blob_size(&content));
1063 blob_reset(&content);
1064 return TH_OK;
1065 }else{
 
1066 return TH_ERROR;
1067 }
1068 }else{
1069 Th_SetResult(interp, "repository unavailable", -1);
1070 return TH_ERROR;
1071
+10 -10
--- test/th1-tcl.test
+++ test/th1-tcl.test
@@ -32,11 +32,11 @@
3232
3333
set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test.
3434
3535
###############################################################################
3636
37
-fossil test-th-render --th-open-config \
37
+fossil test-th-render --open-config \
3838
[file nativename [file join $dir th1-tcl1.txt]]
3939
4040
test th1-tcl-1 {[regexp -- {^tclReady\(before\) = 0
4141
tclReady\(after\) = 1
4242
\d+
@@ -59,60 +59,60 @@
5959
three words now
6060
$} [string map [list \r\n \n] $RESULT]]}
6161
6262
###############################################################################
6363
64
-fossil test-th-render --th-open-config \
64
+fossil test-th-render --open-config \
6565
[file nativename [file join $dir th1-tcl2.txt]]
6666
6767
test th1-tcl-2 {[regexp -- {^\d+
6868
$} [string map [list \r\n \n] $RESULT]]}
6969
7070
###############################################################################
7171
72
-fossil test-th-render --th-open-config \
72
+fossil test-th-render --open-config \
7373
[file nativename [file join $dir th1-tcl3.txt]]
7474
7575
test th1-tcl-3 {$RESULT eq {<hr><p class="thmainError">ERROR:\
7676
invalid command name &quot;bad_command&quot;</p>}}
7777
7878
###############################################################################
7979
80
-fossil test-th-render --th-open-config \
80
+fossil test-th-render --open-config \
8181
[file nativename [file join $dir th1-tcl4.txt]]
8282
8383
test th1-tcl-4 {$RESULT eq {<hr><p class="thmainError">ERROR:\
8484
divide by zero</p>}}
8585
8686
###############################################################################
8787
88
-fossil test-th-render --th-open-config \
88
+fossil test-th-render --open-config \
8989
[file nativename [file join $dir th1-tcl5.txt]]
9090
9191
test th1-tcl-5 {$RESULT eq {<hr><p class="thmainError">ERROR:\
9292
Tcl command not found: bad_command</p>} || $RESULT eq {<hr><p\
9393
class="thmainError">ERROR: invalid command name &quot;bad_command&quot;</p>}}
9494
9595
###############################################################################
9696
97
-fossil test-th-render --th-open-config \
97
+fossil test-th-render --open-config \
9898
[file nativename [file join $dir th1-tcl6.txt]]
9999
100100
test th1-tcl-6 {$RESULT eq {<hr><p class="thmainError">ERROR:\
101101
no such command: bad_command</p>}}
102102
103103
###############################################################################
104104
105
-fossil test-th-render --th-open-config \
105
+fossil test-th-render --open-config \
106106
[file nativename [file join $dir th1-tcl7.txt]]
107107
108108
test th1-tcl-7 {$RESULT eq {<hr><p class="thmainError">ERROR:\
109109
syntax error in expression: &quot;2**0&quot;</p>}}
110110
111111
###############################################################################
112112
113
-fossil test-th-render --th-open-config \
113
+fossil test-th-render --open-config \
114114
[file nativename [file join $dir th1-tcl8.txt]]
115115
116116
test th1-tcl-8 {$RESULT eq {<hr><p class="thmainError">ERROR:\
117117
cannot invoke Tcl command: tailcall</p>} || $RESULT eq {<hr><p\
118118
class="thmainError">ERROR: tailcall can only be called from a proc or\
@@ -119,11 +119,11 @@
119119
lambda</p>} || $RESULT eq {<hr><p class="thmainError">ERROR: This test\
120120
requires Tcl 8.6 or higher.</p>}}
121121
122122
###############################################################################
123123
124
-fossil test-th-render --th-open-config \
124
+fossil test-th-render --open-config \
125125
[file nativename [file join $dir th1-tcl9.txt]]
126126
127127
test th1-tcl-9 {[string trim $RESULT] eq [list [file tail $fossilexe] 3 \
128
-[list test-th-render --th-open-config [file nativename [file join $dir \
128
+[list test-th-render --open-config [file nativename [file join $dir \
129129
th1-tcl9.txt]]]]}
130130
--- test/th1-tcl.test
+++ test/th1-tcl.test
@@ -32,11 +32,11 @@
32
33 set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test.
34
35 ###############################################################################
36
37 fossil test-th-render --th-open-config \
38 [file nativename [file join $dir th1-tcl1.txt]]
39
40 test th1-tcl-1 {[regexp -- {^tclReady\(before\) = 0
41 tclReady\(after\) = 1
42 \d+
@@ -59,60 +59,60 @@
59 three words now
60 $} [string map [list \r\n \n] $RESULT]]}
61
62 ###############################################################################
63
64 fossil test-th-render --th-open-config \
65 [file nativename [file join $dir th1-tcl2.txt]]
66
67 test th1-tcl-2 {[regexp -- {^\d+
68 $} [string map [list \r\n \n] $RESULT]]}
69
70 ###############################################################################
71
72 fossil test-th-render --th-open-config \
73 [file nativename [file join $dir th1-tcl3.txt]]
74
75 test th1-tcl-3 {$RESULT eq {<hr><p class="thmainError">ERROR:\
76 invalid command name &quot;bad_command&quot;</p>}}
77
78 ###############################################################################
79
80 fossil test-th-render --th-open-config \
81 [file nativename [file join $dir th1-tcl4.txt]]
82
83 test th1-tcl-4 {$RESULT eq {<hr><p class="thmainError">ERROR:\
84 divide by zero</p>}}
85
86 ###############################################################################
87
88 fossil test-th-render --th-open-config \
89 [file nativename [file join $dir th1-tcl5.txt]]
90
91 test th1-tcl-5 {$RESULT eq {<hr><p class="thmainError">ERROR:\
92 Tcl command not found: bad_command</p>} || $RESULT eq {<hr><p\
93 class="thmainError">ERROR: invalid command name &quot;bad_command&quot;</p>}}
94
95 ###############################################################################
96
97 fossil test-th-render --th-open-config \
98 [file nativename [file join $dir th1-tcl6.txt]]
99
100 test th1-tcl-6 {$RESULT eq {<hr><p class="thmainError">ERROR:\
101 no such command: bad_command</p>}}
102
103 ###############################################################################
104
105 fossil test-th-render --th-open-config \
106 [file nativename [file join $dir th1-tcl7.txt]]
107
108 test th1-tcl-7 {$RESULT eq {<hr><p class="thmainError">ERROR:\
109 syntax error in expression: &quot;2**0&quot;</p>}}
110
111 ###############################################################################
112
113 fossil test-th-render --th-open-config \
114 [file nativename [file join $dir th1-tcl8.txt]]
115
116 test th1-tcl-8 {$RESULT eq {<hr><p class="thmainError">ERROR:\
117 cannot invoke Tcl command: tailcall</p>} || $RESULT eq {<hr><p\
118 class="thmainError">ERROR: tailcall can only be called from a proc or\
@@ -119,11 +119,11 @@
119 lambda</p>} || $RESULT eq {<hr><p class="thmainError">ERROR: This test\
120 requires Tcl 8.6 or higher.</p>}}
121
122 ###############################################################################
123
124 fossil test-th-render --th-open-config \
125 [file nativename [file join $dir th1-tcl9.txt]]
126
127 test th1-tcl-9 {[string trim $RESULT] eq [list [file tail $fossilexe] 3 \
128 [list test-th-render --th-open-config [file nativename [file join $dir \
129 th1-tcl9.txt]]]]}
130
--- test/th1-tcl.test
+++ test/th1-tcl.test
@@ -32,11 +32,11 @@
32
33 set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test.
34
35 ###############################################################################
36
37 fossil test-th-render --open-config \
38 [file nativename [file join $dir th1-tcl1.txt]]
39
40 test th1-tcl-1 {[regexp -- {^tclReady\(before\) = 0
41 tclReady\(after\) = 1
42 \d+
@@ -59,60 +59,60 @@
59 three words now
60 $} [string map [list \r\n \n] $RESULT]]}
61
62 ###############################################################################
63
64 fossil test-th-render --open-config \
65 [file nativename [file join $dir th1-tcl2.txt]]
66
67 test th1-tcl-2 {[regexp -- {^\d+
68 $} [string map [list \r\n \n] $RESULT]]}
69
70 ###############################################################################
71
72 fossil test-th-render --open-config \
73 [file nativename [file join $dir th1-tcl3.txt]]
74
75 test th1-tcl-3 {$RESULT eq {<hr><p class="thmainError">ERROR:\
76 invalid command name &quot;bad_command&quot;</p>}}
77
78 ###############################################################################
79
80 fossil test-th-render --open-config \
81 [file nativename [file join $dir th1-tcl4.txt]]
82
83 test th1-tcl-4 {$RESULT eq {<hr><p class="thmainError">ERROR:\
84 divide by zero</p>}}
85
86 ###############################################################################
87
88 fossil test-th-render --open-config \
89 [file nativename [file join $dir th1-tcl5.txt]]
90
91 test th1-tcl-5 {$RESULT eq {<hr><p class="thmainError">ERROR:\
92 Tcl command not found: bad_command</p>} || $RESULT eq {<hr><p\
93 class="thmainError">ERROR: invalid command name &quot;bad_command&quot;</p>}}
94
95 ###############################################################################
96
97 fossil test-th-render --open-config \
98 [file nativename [file join $dir th1-tcl6.txt]]
99
100 test th1-tcl-6 {$RESULT eq {<hr><p class="thmainError">ERROR:\
101 no such command: bad_command</p>}}
102
103 ###############################################################################
104
105 fossil test-th-render --open-config \
106 [file nativename [file join $dir th1-tcl7.txt]]
107
108 test th1-tcl-7 {$RESULT eq {<hr><p class="thmainError">ERROR:\
109 syntax error in expression: &quot;2**0&quot;</p>}}
110
111 ###############################################################################
112
113 fossil test-th-render --open-config \
114 [file nativename [file join $dir th1-tcl8.txt]]
115
116 test th1-tcl-8 {$RESULT eq {<hr><p class="thmainError">ERROR:\
117 cannot invoke Tcl command: tailcall</p>} || $RESULT eq {<hr><p\
118 class="thmainError">ERROR: tailcall can only be called from a proc or\
@@ -119,11 +119,11 @@
119 lambda</p>} || $RESULT eq {<hr><p class="thmainError">ERROR: This test\
120 requires Tcl 8.6 or higher.</p>}}
121
122 ###############################################################################
123
124 fossil test-th-render --open-config \
125 [file nativename [file join $dir th1-tcl9.txt]]
126
127 test th1-tcl-9 {[string trim $RESULT] eq [list [file tail $fossilexe] 3 \
128 [list test-th-render --open-config [file nativename [file join $dir \
129 th1-tcl9.txt]]]]}
130
+21 -21
--- test/th1.test
+++ test/th1.test
@@ -16,63 +16,63 @@
1616
############################################################################
1717
#
1818
# TH1 Commands
1919
#
2020
21
-fossil test-th-eval --th-open-config "setting th1-hooks"
21
+fossil test-th-eval --open-config "setting th1-hooks"
2222
set th1Hooks [expr {$RESULT eq "1"}]
2323
2424
###############################################################################
2525
26
-fossil test-th-eval --th-open-config "setting abc"
26
+fossil test-th-eval --open-config "setting abc"
2727
test th1-setting-1 {$RESULT eq ""}
2828
2929
###############################################################################
3030
31
-fossil test-th-eval --th-open-config "setting -- abc"
31
+fossil test-th-eval --open-config "setting -- abc"
3232
test th1-setting-2 {$RESULT eq ""}
3333
3434
###############################################################################
3535
36
-fossil test-th-eval --th-open-config "setting -strict abc"
36
+fossil test-th-eval --open-config "setting -strict abc"
3737
test th1-setting-3 {$RESULT eq {TH_ERROR: no value for setting "abc"}}
3838
3939
###############################################################################
4040
41
-fossil test-th-eval --th-open-config "setting -strict -- abc"
41
+fossil test-th-eval --open-config "setting -strict -- abc"
4242
test th1-setting-4 {$RESULT eq {TH_ERROR: no value for setting "abc"}}
4343
4444
###############################################################################
4545
46
-fossil test-th-eval --th-open-config "setting autosync"
46
+fossil test-th-eval --open-config "setting autosync"
4747
test th1-setting-5 {$RESULT eq 0 || $RESULT eq 1}
4848
4949
###############################################################################
5050
51
-fossil test-th-eval --th-open-config "setting -strict autosync"
51
+fossil test-th-eval --open-config "setting -strict autosync"
5252
test th1-setting-6 {$RESULT eq 0 || $RESULT eq 1}
5353
5454
###############################################################################
5555
56
-fossil test-th-eval --th-open-config "setting --"
56
+fossil test-th-eval --open-config "setting --"
5757
test th1-setting-7 {$RESULT eq \
5858
{TH_ERROR: wrong # args: should be "setting ?-strict? ?--? name"}}
5959
6060
###############################################################################
6161
62
-fossil test-th-eval --th-open-config "setting -strict --"
62
+fossil test-th-eval --open-config "setting -strict --"
6363
test th1-setting-8 {$RESULT eq \
6464
{TH_ERROR: wrong # args: should be "setting ?-strict? ?--? name"}}
6565
6666
###############################################################################
6767
68
-fossil test-th-eval --th-open-config "setting -- --"
68
+fossil test-th-eval --open-config "setting -- --"
6969
test th1-setting-9 {$RESULT eq {}}
7070
7171
###############################################################################
7272
73
-fossil test-th-eval --th-open-config "setting -strict -- --"
73
+fossil test-th-eval --open-config "setting -strict -- --"
7474
test th1-setting-10 {$RESULT eq {TH_ERROR: no value for setting "--"}}
7575
7676
###############################################################################
7777
7878
fossil test-th-eval "expr 42/0"
@@ -595,26 +595,26 @@
595595
fossil test-th-eval "styleHeader {Page Title Here}"
596596
test th1-header-1 {$RESULT eq {TH_ERROR: repository unavailable}}
597597
598598
###############################################################################
599599
600
-fossil test-th-eval --th-open-config "styleHeader {Page Title Here}"
600
+fossil test-th-eval --open-config "styleHeader {Page Title Here}"
601601
test th1-header-2 {[regexp -- {<title>Fossil: Page Title Here</title>} $RESULT]}
602602
603603
###############################################################################
604604
605605
fossil test-th-eval "styleFooter"
606606
test th1-footer-1 {$RESULT eq {TH_ERROR: repository unavailable}}
607607
608608
###############################################################################
609609
610
-fossil test-th-eval --th-open-config "styleFooter"
610
+fossil test-th-eval --open-config "styleFooter"
611611
test th1-footer-2 {$RESULT eq {}}
612612
613613
###############################################################################
614614
615
-fossil test-th-eval --th-open-config --th-force-cgi "styleHeader {}; styleFooter"
615
+fossil test-th-eval --open-config --cgi "styleHeader {}; styleFooter"
616616
test th1-footer-3 {[regexp -- {</body></html>} $RESULT]}
617617
618618
###############################################################################
619619
620620
fossil test-th-eval "getParameter"
@@ -678,42 +678,42 @@
678678
fossil test-th-eval "artifact tip"
679679
test th1-artifact-2 {$RESULT eq {TH_ERROR: repository unavailable}}
680680
681681
###############################################################################
682682
683
-fossil test-th-eval --th-open-config "artifact tip"
683
+fossil test-th-eval --open-config "artifact tip"
684684
test th1-artifact-3 {[regexp -- {F test/th1\.test [0-9a-f]{40}} $RESULT]}
685685
686686
###############################################################################
687687
688688
fossil test-th-eval "artifact 0000000000"
689689
test th1-artifact-4 {$RESULT eq {TH_ERROR: repository unavailable}}
690690
691691
###############################################################################
692692
693
-fossil test-th-eval --th-open-config "artifact 0000000000"
694
-test th1-artifact-5 {$RESULT eq {TH_ERROR: artifact not found}}
693
+fossil test-th-eval --open-config "artifact 0000000000"
694
+test th1-artifact-5 {$RESULT eq {TH_ERROR: name not found}}
695695
696696
###############################################################################
697697
698698
fossil test-th-eval "artifact tip test/th1.test"
699699
test th1-artifact-6 {$RESULT eq {TH_ERROR: repository unavailable}}
700700
701701
###############################################################################
702702
703
-fossil test-th-eval --th-open-config "artifact tip test/th1.test"
703
+fossil test-th-eval --open-config "artifact tip test/th1.test"
704704
test th1-artifact-7 {[regexp -- {th1-artifact-7} $RESULT]}
705705
706706
###############################################################################
707707
708708
fossil test-th-eval "artifact 0000000000 test/th1.test"
709709
test th1-artifact-8 {$RESULT eq {TH_ERROR: repository unavailable}}
710710
711711
###############################################################################
712712
713
-fossil test-th-eval --th-open-config "artifact 0000000000 test/th1.test"
714
-test th1-artifact-9 {$RESULT eq {TH_ERROR: artifact not found}}
713
+fossil test-th-eval --open-config "artifact 0000000000 test/th1.test"
714
+test th1-artifact-9 {$RESULT eq {TH_ERROR: manifest not found}}
715715
716716
###############################################################################
717717
718718
fossil test-th-eval "globalState checkout"
719719
test th1-globalState-1 {[string length $RESULT] > 0}
@@ -728,11 +728,11 @@
728728
fossil test-th-eval "globalState configuration"
729729
test th1-globalState-3 {[string length $RESULT] == 0}
730730
731731
###############################################################################
732732
733
-fossil test-th-eval --th-open-config "globalState configuration"
733
+fossil test-th-eval --open-config "globalState configuration"
734734
test th1-globalState-4 {[string length $RESULT] > 0}
735735
736736
###############################################################################
737737
738738
fossil test-th-eval "globalState executable"
739739
--- test/th1.test
+++ test/th1.test
@@ -16,63 +16,63 @@
16 ############################################################################
17 #
18 # TH1 Commands
19 #
20
21 fossil test-th-eval --th-open-config "setting th1-hooks"
22 set th1Hooks [expr {$RESULT eq "1"}]
23
24 ###############################################################################
25
26 fossil test-th-eval --th-open-config "setting abc"
27 test th1-setting-1 {$RESULT eq ""}
28
29 ###############################################################################
30
31 fossil test-th-eval --th-open-config "setting -- abc"
32 test th1-setting-2 {$RESULT eq ""}
33
34 ###############################################################################
35
36 fossil test-th-eval --th-open-config "setting -strict abc"
37 test th1-setting-3 {$RESULT eq {TH_ERROR: no value for setting "abc"}}
38
39 ###############################################################################
40
41 fossil test-th-eval --th-open-config "setting -strict -- abc"
42 test th1-setting-4 {$RESULT eq {TH_ERROR: no value for setting "abc"}}
43
44 ###############################################################################
45
46 fossil test-th-eval --th-open-config "setting autosync"
47 test th1-setting-5 {$RESULT eq 0 || $RESULT eq 1}
48
49 ###############################################################################
50
51 fossil test-th-eval --th-open-config "setting -strict autosync"
52 test th1-setting-6 {$RESULT eq 0 || $RESULT eq 1}
53
54 ###############################################################################
55
56 fossil test-th-eval --th-open-config "setting --"
57 test th1-setting-7 {$RESULT eq \
58 {TH_ERROR: wrong # args: should be "setting ?-strict? ?--? name"}}
59
60 ###############################################################################
61
62 fossil test-th-eval --th-open-config "setting -strict --"
63 test th1-setting-8 {$RESULT eq \
64 {TH_ERROR: wrong # args: should be "setting ?-strict? ?--? name"}}
65
66 ###############################################################################
67
68 fossil test-th-eval --th-open-config "setting -- --"
69 test th1-setting-9 {$RESULT eq {}}
70
71 ###############################################################################
72
73 fossil test-th-eval --th-open-config "setting -strict -- --"
74 test th1-setting-10 {$RESULT eq {TH_ERROR: no value for setting "--"}}
75
76 ###############################################################################
77
78 fossil test-th-eval "expr 42/0"
@@ -595,26 +595,26 @@
595 fossil test-th-eval "styleHeader {Page Title Here}"
596 test th1-header-1 {$RESULT eq {TH_ERROR: repository unavailable}}
597
598 ###############################################################################
599
600 fossil test-th-eval --th-open-config "styleHeader {Page Title Here}"
601 test th1-header-2 {[regexp -- {<title>Fossil: Page Title Here</title>} $RESULT]}
602
603 ###############################################################################
604
605 fossil test-th-eval "styleFooter"
606 test th1-footer-1 {$RESULT eq {TH_ERROR: repository unavailable}}
607
608 ###############################################################################
609
610 fossil test-th-eval --th-open-config "styleFooter"
611 test th1-footer-2 {$RESULT eq {}}
612
613 ###############################################################################
614
615 fossil test-th-eval --th-open-config --th-force-cgi "styleHeader {}; styleFooter"
616 test th1-footer-3 {[regexp -- {</body></html>} $RESULT]}
617
618 ###############################################################################
619
620 fossil test-th-eval "getParameter"
@@ -678,42 +678,42 @@
678 fossil test-th-eval "artifact tip"
679 test th1-artifact-2 {$RESULT eq {TH_ERROR: repository unavailable}}
680
681 ###############################################################################
682
683 fossil test-th-eval --th-open-config "artifact tip"
684 test th1-artifact-3 {[regexp -- {F test/th1\.test [0-9a-f]{40}} $RESULT]}
685
686 ###############################################################################
687
688 fossil test-th-eval "artifact 0000000000"
689 test th1-artifact-4 {$RESULT eq {TH_ERROR: repository unavailable}}
690
691 ###############################################################################
692
693 fossil test-th-eval --th-open-config "artifact 0000000000"
694 test th1-artifact-5 {$RESULT eq {TH_ERROR: artifact not found}}
695
696 ###############################################################################
697
698 fossil test-th-eval "artifact tip test/th1.test"
699 test th1-artifact-6 {$RESULT eq {TH_ERROR: repository unavailable}}
700
701 ###############################################################################
702
703 fossil test-th-eval --th-open-config "artifact tip test/th1.test"
704 test th1-artifact-7 {[regexp -- {th1-artifact-7} $RESULT]}
705
706 ###############################################################################
707
708 fossil test-th-eval "artifact 0000000000 test/th1.test"
709 test th1-artifact-8 {$RESULT eq {TH_ERROR: repository unavailable}}
710
711 ###############################################################################
712
713 fossil test-th-eval --th-open-config "artifact 0000000000 test/th1.test"
714 test th1-artifact-9 {$RESULT eq {TH_ERROR: artifact not found}}
715
716 ###############################################################################
717
718 fossil test-th-eval "globalState checkout"
719 test th1-globalState-1 {[string length $RESULT] > 0}
@@ -728,11 +728,11 @@
728 fossil test-th-eval "globalState configuration"
729 test th1-globalState-3 {[string length $RESULT] == 0}
730
731 ###############################################################################
732
733 fossil test-th-eval --th-open-config "globalState configuration"
734 test th1-globalState-4 {[string length $RESULT] > 0}
735
736 ###############################################################################
737
738 fossil test-th-eval "globalState executable"
739
--- test/th1.test
+++ test/th1.test
@@ -16,63 +16,63 @@
16 ############################################################################
17 #
18 # TH1 Commands
19 #
20
21 fossil test-th-eval --open-config "setting th1-hooks"
22 set th1Hooks [expr {$RESULT eq "1"}]
23
24 ###############################################################################
25
26 fossil test-th-eval --open-config "setting abc"
27 test th1-setting-1 {$RESULT eq ""}
28
29 ###############################################################################
30
31 fossil test-th-eval --open-config "setting -- abc"
32 test th1-setting-2 {$RESULT eq ""}
33
34 ###############################################################################
35
36 fossil test-th-eval --open-config "setting -strict abc"
37 test th1-setting-3 {$RESULT eq {TH_ERROR: no value for setting "abc"}}
38
39 ###############################################################################
40
41 fossil test-th-eval --open-config "setting -strict -- abc"
42 test th1-setting-4 {$RESULT eq {TH_ERROR: no value for setting "abc"}}
43
44 ###############################################################################
45
46 fossil test-th-eval --open-config "setting autosync"
47 test th1-setting-5 {$RESULT eq 0 || $RESULT eq 1}
48
49 ###############################################################################
50
51 fossil test-th-eval --open-config "setting -strict autosync"
52 test th1-setting-6 {$RESULT eq 0 || $RESULT eq 1}
53
54 ###############################################################################
55
56 fossil test-th-eval --open-config "setting --"
57 test th1-setting-7 {$RESULT eq \
58 {TH_ERROR: wrong # args: should be "setting ?-strict? ?--? name"}}
59
60 ###############################################################################
61
62 fossil test-th-eval --open-config "setting -strict --"
63 test th1-setting-8 {$RESULT eq \
64 {TH_ERROR: wrong # args: should be "setting ?-strict? ?--? name"}}
65
66 ###############################################################################
67
68 fossil test-th-eval --open-config "setting -- --"
69 test th1-setting-9 {$RESULT eq {}}
70
71 ###############################################################################
72
73 fossil test-th-eval --open-config "setting -strict -- --"
74 test th1-setting-10 {$RESULT eq {TH_ERROR: no value for setting "--"}}
75
76 ###############################################################################
77
78 fossil test-th-eval "expr 42/0"
@@ -595,26 +595,26 @@
595 fossil test-th-eval "styleHeader {Page Title Here}"
596 test th1-header-1 {$RESULT eq {TH_ERROR: repository unavailable}}
597
598 ###############################################################################
599
600 fossil test-th-eval --open-config "styleHeader {Page Title Here}"
601 test th1-header-2 {[regexp -- {<title>Fossil: Page Title Here</title>} $RESULT]}
602
603 ###############################################################################
604
605 fossil test-th-eval "styleFooter"
606 test th1-footer-1 {$RESULT eq {TH_ERROR: repository unavailable}}
607
608 ###############################################################################
609
610 fossil test-th-eval --open-config "styleFooter"
611 test th1-footer-2 {$RESULT eq {}}
612
613 ###############################################################################
614
615 fossil test-th-eval --open-config --cgi "styleHeader {}; styleFooter"
616 test th1-footer-3 {[regexp -- {</body></html>} $RESULT]}
617
618 ###############################################################################
619
620 fossil test-th-eval "getParameter"
@@ -678,42 +678,42 @@
678 fossil test-th-eval "artifact tip"
679 test th1-artifact-2 {$RESULT eq {TH_ERROR: repository unavailable}}
680
681 ###############################################################################
682
683 fossil test-th-eval --open-config "artifact tip"
684 test th1-artifact-3 {[regexp -- {F test/th1\.test [0-9a-f]{40}} $RESULT]}
685
686 ###############################################################################
687
688 fossil test-th-eval "artifact 0000000000"
689 test th1-artifact-4 {$RESULT eq {TH_ERROR: repository unavailable}}
690
691 ###############################################################################
692
693 fossil test-th-eval --open-config "artifact 0000000000"
694 test th1-artifact-5 {$RESULT eq {TH_ERROR: name not found}}
695
696 ###############################################################################
697
698 fossil test-th-eval "artifact tip test/th1.test"
699 test th1-artifact-6 {$RESULT eq {TH_ERROR: repository unavailable}}
700
701 ###############################################################################
702
703 fossil test-th-eval --open-config "artifact tip test/th1.test"
704 test th1-artifact-7 {[regexp -- {th1-artifact-7} $RESULT]}
705
706 ###############################################################################
707
708 fossil test-th-eval "artifact 0000000000 test/th1.test"
709 test th1-artifact-8 {$RESULT eq {TH_ERROR: repository unavailable}}
710
711 ###############################################################################
712
713 fossil test-th-eval --open-config "artifact 0000000000 test/th1.test"
714 test th1-artifact-9 {$RESULT eq {TH_ERROR: manifest not found}}
715
716 ###############################################################################
717
718 fossil test-th-eval "globalState checkout"
719 test th1-globalState-1 {[string length $RESULT] > 0}
@@ -728,11 +728,11 @@
728 fossil test-th-eval "globalState configuration"
729 test th1-globalState-3 {[string length $RESULT] == 0}
730
731 ###############################################################################
732
733 fossil test-th-eval --open-config "globalState configuration"
734 test th1-globalState-4 {[string length $RESULT] > 0}
735
736 ###############################################################################
737
738 fossil test-th-eval "globalState executable"
739

Keyboard Shortcuts

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