Fossil SCM

Do not use the Tcl global variable name 'dir'.

mistachkin 2016-10-04 23:27 trunk
Commit 64b812bd4ef8d31cc44ae35c18a810aaa8ce6c74
--- test/mv-rm.test
+++ test/mv-rm.test
@@ -15,10 +15,12 @@
1515
#
1616
############################################################################
1717
#
1818
# MV / RM Commands
1919
#
20
+
21
+set path [file dirname [info script]]
2022
2123
require_no_open_checkout
2224
2325
########################################
2426
# Setup: Add Files and Commit #
2527
--- test/mv-rm.test
+++ test/mv-rm.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # MV / RM Commands
19 #
 
 
20
21 require_no_open_checkout
22
23 ########################################
24 # Setup: Add Files and Commit #
25
--- test/mv-rm.test
+++ test/mv-rm.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # MV / RM Commands
19 #
20
21 set path [file dirname [info script]]
22
23 require_no_open_checkout
24
25 ########################################
26 # Setup: Add Files and Commit #
27
--- test/settings-repo.test
+++ test/settings-repo.test
@@ -16,12 +16,15 @@
1616
############################################################################
1717
#
1818
# The "settings" and "unset" commands that may modify the repository.
1919
#
2020
21
+set path [file dirname [info script]]
22
+
2123
require_no_open_checkout
22
-set dir [file dirname [info script]]; test_setup
24
+
25
+test_setup
2326
2427
###############################################################################
2528
#
2629
# Complete syntax as tested:
2730
#
2831
--- test/settings-repo.test
+++ test/settings-repo.test
@@ -16,12 +16,15 @@
16 ############################################################################
17 #
18 # The "settings" and "unset" commands that may modify the repository.
19 #
20
 
 
21 require_no_open_checkout
22 set dir [file dirname [info script]]; test_setup
 
23
24 ###############################################################################
25 #
26 # Complete syntax as tested:
27 #
28
--- test/settings-repo.test
+++ test/settings-repo.test
@@ -16,12 +16,15 @@
16 ############################################################################
17 #
18 # The "settings" and "unset" commands that may modify the repository.
19 #
20
21 set path [file dirname [info script]]
22
23 require_no_open_checkout
24
25 test_setup
26
27 ###############################################################################
28 #
29 # Complete syntax as tested:
30 #
31
--- test/settings.test
+++ test/settings.test
@@ -16,11 +16,11 @@
1616
############################################################################
1717
#
1818
# The "settings" and "unset" commands.
1919
#
2020
21
-set dir [file dirname [info script]]; test_setup
21
+set path [file dirname [info script]]; test_setup
2222
2323
###############################################################################
2424
#
2525
# Complete syntax as tested:
2626
#
2727
--- test/settings.test
+++ test/settings.test
@@ -16,11 +16,11 @@
16 ############################################################################
17 #
18 # The "settings" and "unset" commands.
19 #
20
21 set dir [file dirname [info script]]; test_setup
22
23 ###############################################################################
24 #
25 # Complete syntax as tested:
26 #
27
--- test/settings.test
+++ test/settings.test
@@ -16,11 +16,11 @@
16 ############################################################################
17 #
18 # The "settings" and "unset" commands.
19 #
20
21 set path [file dirname [info script]]; test_setup
22
23 ###############################################################################
24 #
25 # Complete syntax as tested:
26 #
27
--- test/symlinks.test
+++ test/symlinks.test
@@ -15,10 +15,12 @@
1515
#
1616
############################################################################
1717
#
1818
# Symbolic link tests.
1919
#
20
+
21
+set path [file dirname [info script]]
2022
2123
if {$tcl_platform(platform) eq "windows"} {
2224
puts "Symlinks are not supported on Windows."
2325
test_cleanup_then_return
2426
}
2527
--- test/symlinks.test
+++ test/symlinks.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Symbolic link tests.
19 #
 
 
20
21 if {$tcl_platform(platform) eq "windows"} {
22 puts "Symlinks are not supported on Windows."
23 test_cleanup_then_return
24 }
25
--- test/symlinks.test
+++ test/symlinks.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Symbolic link tests.
19 #
20
21 set path [file dirname [info script]]
22
23 if {$tcl_platform(platform) eq "windows"} {
24 puts "Symlinks are not supported on Windows."
25 test_cleanup_then_return
26 }
27
--- test/th1-repo.test
+++ test/th1-repo.test
@@ -19,10 +19,12 @@
1919
############################################################################
2020
#
2121
# TH1 tests that may modify the repository
2222
#
2323
24
+set path [file dirname [info script]]
25
+
2426
require_no_open_checkout
2527
2628
########################################
2729
# Setup: Add Files and Commit #
2830
########################################
@@ -51,12 +53,10 @@
5153
set files_md [list subdirB/f5.md subdirB/f6.md subdirB/f8.md subdirC/f10.md]
5254
5355
fossil add $rootDir
5456
fossil commit -m "c1"
5557
56
-set dir [file dirname [info script]]
57
-
5858
###############################################################################
5959
6060
fossil test-th-eval --open-config "dir trunk subdir*/*.md"
6161
test th1-dir-1 {[llength $RESULT] eq [llength $files_md]}
6262
6363
--- test/th1-repo.test
+++ test/th1-repo.test
@@ -19,10 +19,12 @@
19 ############################################################################
20 #
21 # TH1 tests that may modify the repository
22 #
23
 
 
24 require_no_open_checkout
25
26 ########################################
27 # Setup: Add Files and Commit #
28 ########################################
@@ -51,12 +53,10 @@
51 set files_md [list subdirB/f5.md subdirB/f6.md subdirB/f8.md subdirC/f10.md]
52
53 fossil add $rootDir
54 fossil commit -m "c1"
55
56 set dir [file dirname [info script]]
57
58 ###############################################################################
59
60 fossil test-th-eval --open-config "dir trunk subdir*/*.md"
61 test th1-dir-1 {[llength $RESULT] eq [llength $files_md]}
62
63
--- test/th1-repo.test
+++ test/th1-repo.test
@@ -19,10 +19,12 @@
19 ############################################################################
20 #
21 # TH1 tests that may modify the repository
22 #
23
24 set path [file dirname [info script]]
25
26 require_no_open_checkout
27
28 ########################################
29 # Setup: Add Files and Commit #
30 ########################################
@@ -51,12 +53,10 @@
53 set files_md [list subdirB/f5.md subdirB/f6.md subdirB/f8.md subdirC/f10.md]
54
55 fossil add $rootDir
56 fossil commit -m "c1"
57
 
 
58 ###############################################################################
59
60 fossil test-th-eval --open-config "dir trunk subdir*/*.md"
61 test th1-dir-1 {[llength $RESULT] eq [llength $files_md]}
62
63
+11 -11
--- test/th1-tcl.test
+++ test/th1-tcl.test
@@ -16,11 +16,11 @@
1616
############################################################################
1717
#
1818
# TH1/Tcl integration
1919
#
2020
21
-set dir [file dirname [info script]]
21
+set path [file dirname [info script]]
2222
2323
###############################################################################
2424
2525
fossil test-th-eval "hasfeature tcl"
2626
@@ -38,11 +38,11 @@
3838
set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test.
3939
4040
###############################################################################
4141
4242
fossil test-th-render --open-config \
43
- [file nativename [file join $dir th1-tcl1.txt]]
43
+ [file nativename [file join $path th1-tcl1.txt]]
4444
4545
test th1-tcl-1 {[regexp -- {^tclReady\(before\) = 0
4646
tclReady\(after\) = 1
4747
\d+
4848
\d+
@@ -65,62 +65,62 @@
6565
6666
###############################################################################
6767
6868
if {[catch {package require sqlite3}] == 0} {
6969
fossil test-th-render --open-config \
70
- [file nativename [file join $dir th1-tcl2.txt]]
70
+ [file nativename [file join $path th1-tcl2.txt]]
7171
7272
test th1-tcl-2 {[regexp -- {^\d+$} [normalize_result]]}
7373
} else {
7474
puts stderr "Skipping 'th1-tcl-2', SQLite package for Tcl not available"
7575
}
7676
7777
###############################################################################
7878
7979
fossil test-th-render --open-config \
80
- [file nativename [file join $dir th1-tcl3.txt]]
80
+ [file nativename [file join $path th1-tcl3.txt]]
8181
8282
test th1-tcl-3 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
8383
invalid command name &quot;bad_command&quot;</p>}}
8484
8585
###############################################################################
8686
8787
fossil test-th-render --open-config \
88
- [file nativename [file join $dir th1-tcl4.txt]]
88
+ [file nativename [file join $path th1-tcl4.txt]]
8989
9090
test th1-tcl-4 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
9191
divide by zero</p>}}
9292
9393
###############################################################################
9494
9595
fossil test-th-render --open-config \
96
- [file nativename [file join $dir th1-tcl5.txt]]
96
+ [file nativename [file join $path th1-tcl5.txt]]
9797
9898
test th1-tcl-5 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
9999
Tcl command not found: bad_command</p>} || $RESULT eq {<hr /><p\
100100
class="thmainError">ERROR: invalid command name &quot;bad_command&quot;</p>}}
101101
102102
###############################################################################
103103
104104
fossil test-th-render --open-config \
105
- [file nativename [file join $dir th1-tcl6.txt]]
105
+ [file nativename [file join $path th1-tcl6.txt]]
106106
107107
test th1-tcl-6 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
108108
no such command: bad_command</p>}}
109109
110110
###############################################################################
111111
112112
fossil test-th-render --open-config \
113
- [file nativename [file join $dir th1-tcl7.txt]]
113
+ [file nativename [file join $path th1-tcl7.txt]]
114114
115115
test th1-tcl-7 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
116116
syntax error in expression: &quot;2**0&quot;</p>}}
117117
118118
###############################################################################
119119
120120
fossil test-th-render --open-config \
121
- [file nativename [file join $dir th1-tcl8.txt]]
121
+ [file nativename [file join $path th1-tcl8.txt]]
122122
123123
test th1-tcl-8 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
124124
cannot invoke Tcl command: tailcall</p>} || $RESULT eq {<hr /><p\
125125
class="thmainError">ERROR: tailcall can only be called from a proc or\
126126
lambda</p>} || $RESULT eq {<hr /><p class="thmainError">ERROR: This test\
@@ -127,14 +127,14 @@
127127
requires Tcl 8.6 or higher.</p>}}
128128
129129
###############################################################################
130130
131131
fossil test-th-render --open-config \
132
- [file nativename [file join $dir th1-tcl9.txt]]
132
+ [file nativename [file join $path th1-tcl9.txt]]
133133
134134
test th1-tcl-9 {[string trim $RESULT] eq [list [file tail $fossilexe] 3 \
135
-[list test-th-render --open-config [file nativename [file join $dir \
135
+[list test-th-render --open-config [file nativename [file join $path \
136136
th1-tcl9.txt]]]]}
137137
138138
###############################################################################
139139
140140
fossil test-th-eval "tclMakeSafe a"
141141
--- test/th1-tcl.test
+++ test/th1-tcl.test
@@ -16,11 +16,11 @@
16 ############################################################################
17 #
18 # TH1/Tcl integration
19 #
20
21 set dir [file dirname [info script]]
22
23 ###############################################################################
24
25 fossil test-th-eval "hasfeature tcl"
26
@@ -38,11 +38,11 @@
38 set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test.
39
40 ###############################################################################
41
42 fossil test-th-render --open-config \
43 [file nativename [file join $dir th1-tcl1.txt]]
44
45 test th1-tcl-1 {[regexp -- {^tclReady\(before\) = 0
46 tclReady\(after\) = 1
47 \d+
48 \d+
@@ -65,62 +65,62 @@
65
66 ###############################################################################
67
68 if {[catch {package require sqlite3}] == 0} {
69 fossil test-th-render --open-config \
70 [file nativename [file join $dir th1-tcl2.txt]]
71
72 test th1-tcl-2 {[regexp -- {^\d+$} [normalize_result]]}
73 } else {
74 puts stderr "Skipping 'th1-tcl-2', SQLite package for Tcl not available"
75 }
76
77 ###############################################################################
78
79 fossil test-th-render --open-config \
80 [file nativename [file join $dir th1-tcl3.txt]]
81
82 test th1-tcl-3 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
83 invalid command name &quot;bad_command&quot;</p>}}
84
85 ###############################################################################
86
87 fossil test-th-render --open-config \
88 [file nativename [file join $dir th1-tcl4.txt]]
89
90 test th1-tcl-4 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
91 divide by zero</p>}}
92
93 ###############################################################################
94
95 fossil test-th-render --open-config \
96 [file nativename [file join $dir th1-tcl5.txt]]
97
98 test th1-tcl-5 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
99 Tcl command not found: bad_command</p>} || $RESULT eq {<hr /><p\
100 class="thmainError">ERROR: invalid command name &quot;bad_command&quot;</p>}}
101
102 ###############################################################################
103
104 fossil test-th-render --open-config \
105 [file nativename [file join $dir th1-tcl6.txt]]
106
107 test th1-tcl-6 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
108 no such command: bad_command</p>}}
109
110 ###############################################################################
111
112 fossil test-th-render --open-config \
113 [file nativename [file join $dir th1-tcl7.txt]]
114
115 test th1-tcl-7 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
116 syntax error in expression: &quot;2**0&quot;</p>}}
117
118 ###############################################################################
119
120 fossil test-th-render --open-config \
121 [file nativename [file join $dir th1-tcl8.txt]]
122
123 test th1-tcl-8 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
124 cannot invoke Tcl command: tailcall</p>} || $RESULT eq {<hr /><p\
125 class="thmainError">ERROR: tailcall can only be called from a proc or\
126 lambda</p>} || $RESULT eq {<hr /><p class="thmainError">ERROR: This test\
@@ -127,14 +127,14 @@
127 requires Tcl 8.6 or higher.</p>}}
128
129 ###############################################################################
130
131 fossil test-th-render --open-config \
132 [file nativename [file join $dir th1-tcl9.txt]]
133
134 test th1-tcl-9 {[string trim $RESULT] eq [list [file tail $fossilexe] 3 \
135 [list test-th-render --open-config [file nativename [file join $dir \
136 th1-tcl9.txt]]]]}
137
138 ###############################################################################
139
140 fossil test-th-eval "tclMakeSafe a"
141
--- test/th1-tcl.test
+++ test/th1-tcl.test
@@ -16,11 +16,11 @@
16 ############################################################################
17 #
18 # TH1/Tcl integration
19 #
20
21 set path [file dirname [info script]]
22
23 ###############################################################################
24
25 fossil test-th-eval "hasfeature tcl"
26
@@ -38,11 +38,11 @@
38 set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test.
39
40 ###############################################################################
41
42 fossil test-th-render --open-config \
43 [file nativename [file join $path th1-tcl1.txt]]
44
45 test th1-tcl-1 {[regexp -- {^tclReady\(before\) = 0
46 tclReady\(after\) = 1
47 \d+
48 \d+
@@ -65,62 +65,62 @@
65
66 ###############################################################################
67
68 if {[catch {package require sqlite3}] == 0} {
69 fossil test-th-render --open-config \
70 [file nativename [file join $path th1-tcl2.txt]]
71
72 test th1-tcl-2 {[regexp -- {^\d+$} [normalize_result]]}
73 } else {
74 puts stderr "Skipping 'th1-tcl-2', SQLite package for Tcl not available"
75 }
76
77 ###############################################################################
78
79 fossil test-th-render --open-config \
80 [file nativename [file join $path th1-tcl3.txt]]
81
82 test th1-tcl-3 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
83 invalid command name &quot;bad_command&quot;</p>}}
84
85 ###############################################################################
86
87 fossil test-th-render --open-config \
88 [file nativename [file join $path th1-tcl4.txt]]
89
90 test th1-tcl-4 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
91 divide by zero</p>}}
92
93 ###############################################################################
94
95 fossil test-th-render --open-config \
96 [file nativename [file join $path th1-tcl5.txt]]
97
98 test th1-tcl-5 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
99 Tcl command not found: bad_command</p>} || $RESULT eq {<hr /><p\
100 class="thmainError">ERROR: invalid command name &quot;bad_command&quot;</p>}}
101
102 ###############################################################################
103
104 fossil test-th-render --open-config \
105 [file nativename [file join $path th1-tcl6.txt]]
106
107 test th1-tcl-6 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
108 no such command: bad_command</p>}}
109
110 ###############################################################################
111
112 fossil test-th-render --open-config \
113 [file nativename [file join $path th1-tcl7.txt]]
114
115 test th1-tcl-7 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
116 syntax error in expression: &quot;2**0&quot;</p>}}
117
118 ###############################################################################
119
120 fossil test-th-render --open-config \
121 [file nativename [file join $path th1-tcl8.txt]]
122
123 test th1-tcl-8 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
124 cannot invoke Tcl command: tailcall</p>} || $RESULT eq {<hr /><p\
125 class="thmainError">ERROR: tailcall can only be called from a proc or\
126 lambda</p>} || $RESULT eq {<hr /><p class="thmainError">ERROR: This test\
@@ -127,14 +127,14 @@
127 requires Tcl 8.6 or higher.</p>}}
128
129 ###############################################################################
130
131 fossil test-th-render --open-config \
132 [file nativename [file join $path th1-tcl9.txt]]
133
134 test th1-tcl-9 {[string trim $RESULT] eq [list [file tail $fossilexe] 3 \
135 [list test-th-render --open-config [file nativename [file join $path \
136 th1-tcl9.txt]]]]}
137
138 ###############################################################################
139
140 fossil test-th-eval "tclMakeSafe a"
141
+2 -2
--- test/th1.test
+++ test/th1.test
@@ -16,11 +16,11 @@
1616
############################################################################
1717
#
1818
# TH1 Commands
1919
#
2020
21
-set dir [file dirname [info script]]; test_setup
21
+set path [file dirname [info script]]; test_setup
2222
2323
###############################################################################
2424
2525
set th1Tcl [is_tcl_usable_by_fossil]
2626
set th1Hooks [are_th1_hooks_usable_by_fossil]
@@ -1468,11 +1468,11 @@
14681468
</div>
14691469
}}}
14701470
14711471
###############################################################################
14721472
1473
-set markdown [read_file [file join $dir markdown-test1.md]]
1473
+set markdown [read_file [file join $path markdown-test1.md]]
14741474
fossil test-th-eval [string map \
14751475
[list %markdown% $markdown] {markdown {%markdown%}}]
14761476
test th1-markdown-5 {[normalize_result] eq \
14771477
{{Markdown Formatter Test Document} {<div class="markdown">
14781478
14791479
--- test/th1.test
+++ test/th1.test
@@ -16,11 +16,11 @@
16 ############################################################################
17 #
18 # TH1 Commands
19 #
20
21 set dir [file dirname [info script]]; test_setup
22
23 ###############################################################################
24
25 set th1Tcl [is_tcl_usable_by_fossil]
26 set th1Hooks [are_th1_hooks_usable_by_fossil]
@@ -1468,11 +1468,11 @@
1468 </div>
1469 }}}
1470
1471 ###############################################################################
1472
1473 set markdown [read_file [file join $dir markdown-test1.md]]
1474 fossil test-th-eval [string map \
1475 [list %markdown% $markdown] {markdown {%markdown%}}]
1476 test th1-markdown-5 {[normalize_result] eq \
1477 {{Markdown Formatter Test Document} {<div class="markdown">
1478
1479
--- test/th1.test
+++ test/th1.test
@@ -16,11 +16,11 @@
16 ############################################################################
17 #
18 # TH1 Commands
19 #
20
21 set path [file dirname [info script]]; test_setup
22
23 ###############################################################################
24
25 set th1Tcl [is_tcl_usable_by_fossil]
26 set th1Hooks [are_th1_hooks_usable_by_fossil]
@@ -1468,11 +1468,11 @@
1468 </div>
1469 }}}
1470
1471 ###############################################################################
1472
1473 set markdown [read_file [file join $path markdown-test1.md]]
1474 fossil test-th-eval [string map \
1475 [list %markdown% $markdown] {markdown {%markdown%}}]
1476 test th1-markdown-5 {[normalize_result] eq \
1477 {{Markdown Formatter Test Document} {<div class="markdown">
1478
1479

Keyboard Shortcuts

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