Fossil SCM

All test files must now call 'repo_init', using an empty string if they do not require a new repository.

drh 2016-03-02 08:13 UTC testerCleanup
Commit 3a578e049598d1dba9e0632c552c604135051b3a
--- test/cmdline.test
+++ test/cmdline.test
@@ -15,10 +15,12 @@
1515
#
1616
############################################################################
1717
#
1818
# Test command line parsing
1919
#
20
+
21
+repo_init ""
2022
2123
proc cmd-line {testname args} {
2224
set i 1
2325
foreach {cmdline result} $args {
2426
fossil test-echo $cmdline
2527
--- test/cmdline.test
+++ test/cmdline.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Test command line parsing
19 #
 
 
20
21 proc cmd-line {testname args} {
22 set i 1
23 foreach {cmdline result} $args {
24 fossil test-echo $cmdline
25
--- test/cmdline.test
+++ test/cmdline.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Test command line parsing
19 #
20
21 repo_init ""
22
23 proc cmd-line {testname args} {
24 set i 1
25 foreach {cmdline result} $args {
26 fossil test-echo $cmdline
27
--- test/comment.test
+++ test/comment.test
@@ -16,10 +16,14 @@
1616
############################################################################
1717
#
1818
# Test comment formatting and printing.
1919
#
2020
21
+repo_init ""
22
+
23
+###############################################################################
24
+
2125
fossil test-comment-format "" ""
2226
test comment-1 {$RESULT eq "\n(1 lines output)"}
2327
2428
###############################################################################
2529
2630
--- test/comment.test
+++ test/comment.test
@@ -16,10 +16,14 @@
16 ############################################################################
17 #
18 # Test comment formatting and printing.
19 #
20
 
 
 
 
21 fossil test-comment-format "" ""
22 test comment-1 {$RESULT eq "\n(1 lines output)"}
23
24 ###############################################################################
25
26
--- test/comment.test
+++ test/comment.test
@@ -16,10 +16,14 @@
16 ############################################################################
17 #
18 # Test comment formatting and printing.
19 #
20
21 repo_init ""
22
23 ###############################################################################
24
25 fossil test-comment-format "" ""
26 test comment-1 {$RESULT eq "\n(1 lines output)"}
27
28 ###############################################################################
29
30
--- test/contains-selector.test
+++ test/contains-selector.test
@@ -15,10 +15,12 @@
1515
#
1616
############################################################################
1717
#
1818
# Test containsSelector() function in src/style.c
1919
#
20
+
21
+repo_init ""
2022
2123
proc contains-selector {testId css selectorResultMap} {
2224
set css [string trim $css]
2325
set filename [file join $::tempPath compare-selector.css]
2426
set fh [open $filename w]
2527
--- test/contains-selector.test
+++ test/contains-selector.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Test containsSelector() function in src/style.c
19 #
 
 
20
21 proc contains-selector {testId css selectorResultMap} {
22 set css [string trim $css]
23 set filename [file join $::tempPath compare-selector.css]
24 set fh [open $filename w]
25
--- test/contains-selector.test
+++ test/contains-selector.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Test containsSelector() function in src/style.c
19 #
20
21 repo_init ""
22
23 proc contains-selector {testId css selectorResultMap} {
24 set css [string trim $css]
25 set filename [file join $::tempPath compare-selector.css]
26 set fh [open $filename w]
27
--- test/delta1.test
+++ test/delta1.test
@@ -15,10 +15,12 @@
1515
#
1616
############################################################################
1717
#
1818
# Tests of the delta mechanism.
1919
#
20
+
21
+repo_init ""
2022
2123
# Use test script files as the basis for this test.
2224
#
2325
# For each test, copy the file intact to "./t1". Make
2426
# some random changes in "./t2". Then call test-delta on the
2527
--- test/delta1.test
+++ test/delta1.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Tests of the delta mechanism.
19 #
 
 
20
21 # Use test script files as the basis for this test.
22 #
23 # For each test, copy the file intact to "./t1". Make
24 # some random changes in "./t2". Then call test-delta on the
25
--- test/delta1.test
+++ test/delta1.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Tests of the delta mechanism.
19 #
20
21 repo_init ""
22
23 # Use test script files as the basis for this test.
24 #
25 # For each test, copy the file intact to "./t1". Make
26 # some random changes in "./t2". Then call test-delta on the
27
--- test/glob.test
+++ test/glob.test
@@ -15,10 +15,12 @@
1515
#
1616
############################################################################
1717
#
1818
# Test glob pattern parsing
1919
#
20
+
21
+repo_init ""
2022
2123
proc glob-parse {testname args} {
2224
set i 1
2325
foreach {pattern string result} $args {
2426
fossil test-glob $pattern $string
2527
--- test/glob.test
+++ test/glob.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Test glob pattern parsing
19 #
 
 
20
21 proc glob-parse {testname args} {
22 set i 1
23 foreach {pattern string result} $args {
24 fossil test-glob $pattern $string
25
--- test/glob.test
+++ test/glob.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Test glob pattern parsing
19 #
20
21 repo_init ""
22
23 proc glob-parse {testname args} {
24 set i 1
25 foreach {pattern string result} $args {
26 fossil test-glob $pattern $string
27
--- test/merge1.test
+++ test/merge1.test
@@ -15,10 +15,12 @@
1515
#
1616
############################################################################
1717
#
1818
# Tests of the 3-way merge
1919
#
20
+
21
+repo_init ""
2022
2123
write_file_indented t1 {
2224
111 - This is line one of the demo program - 1111
2325
222 - The second line program line in code - 2222
2426
333 - This is a test of the merging algohm - 3333
2527
--- test/merge1.test
+++ test/merge1.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Tests of the 3-way merge
19 #
 
 
20
21 write_file_indented t1 {
22 111 - This is line one of the demo program - 1111
23 222 - The second line program line in code - 2222
24 333 - This is a test of the merging algohm - 3333
25
--- test/merge1.test
+++ test/merge1.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Tests of the 3-way merge
19 #
20
21 repo_init ""
22
23 write_file_indented t1 {
24 111 - This is line one of the demo program - 1111
25 222 - The second line program line in code - 2222
26 333 - This is a test of the merging algohm - 3333
27
--- test/merge2.test
+++ test/merge2.test
@@ -15,10 +15,12 @@
1515
#
1616
############################################################################
1717
#
1818
# Tests of the delta mechanism.
1919
#
20
+
21
+repo_init ""
2022
2123
set filelist [glob $testdir/*]
2224
foreach f $filelist {
2325
if {[file isdir $f]} continue
2426
set base [file root [file tail $f]]
2527
--- test/merge2.test
+++ test/merge2.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Tests of the delta mechanism.
19 #
 
 
20
21 set filelist [glob $testdir/*]
22 foreach f $filelist {
23 if {[file isdir $f]} continue
24 set base [file root [file tail $f]]
25
--- test/merge2.test
+++ test/merge2.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Tests of the delta mechanism.
19 #
20
21 repo_init ""
22
23 set filelist [glob $testdir/*]
24 foreach f $filelist {
25 if {[file isdir $f]} continue
26 set base [file root [file tail $f]]
27
--- test/merge3.test
+++ test/merge3.test
@@ -15,10 +15,12 @@
1515
#
1616
############################################################################
1717
#
1818
# Tests of the 3-way merge
1919
#
20
+
21
+repo_init ""
2022
2123
proc merge-test {testid basis v1 v2 result} {
2224
write_file t1 [join [string trim $basis] \n]\n
2325
write_file t2 [join [string trim $v1] \n]\n
2426
write_file t3 [join [string trim $v2] \n]\n
2527
--- test/merge3.test
+++ test/merge3.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Tests of the 3-way merge
19 #
 
 
20
21 proc merge-test {testid basis v1 v2 result} {
22 write_file t1 [join [string trim $basis] \n]\n
23 write_file t2 [join [string trim $v1] \n]\n
24 write_file t3 [join [string trim $v2] \n]\n
25
--- test/merge3.test
+++ test/merge3.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Tests of the 3-way merge
19 #
20
21 repo_init ""
22
23 proc merge-test {testid basis v1 v2 result} {
24 write_file t1 [join [string trim $basis] \n]\n
25 write_file t2 [join [string trim $v1] \n]\n
26 write_file t3 [join [string trim $v2] \n]\n
27
--- test/merge4.test
+++ test/merge4.test
@@ -15,10 +15,12 @@
1515
#
1616
############################################################################
1717
#
1818
# Tests of the 3-way merge
1919
#
20
+
21
+repo_init ""
2022
2123
proc merge-test {testid basis v1 v2 result1 result2} {
2224
write_file t1 [join [string trim $basis] \n]\n
2325
write_file t2 [join [string trim $v1] \n]\n
2426
write_file t3 [join [string trim $v2] \n]\n
2527
--- test/merge4.test
+++ test/merge4.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Tests of the 3-way merge
19 #
 
 
20
21 proc merge-test {testid basis v1 v2 result1 result2} {
22 write_file t1 [join [string trim $basis] \n]\n
23 write_file t2 [join [string trim $v1] \n]\n
24 write_file t3 [join [string trim $v2] \n]\n
25
--- test/merge4.test
+++ test/merge4.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Tests of the 3-way merge
19 #
20
21 repo_init ""
22
23 proc merge-test {testid basis v1 v2 result1 result2} {
24 write_file t1 [join [string trim $basis] \n]\n
25 write_file t2 [join [string trim $v1] \n]\n
26 write_file t3 [join [string trim $v2] \n]\n
27
+24 -19
--- test/tester.tcl
+++ test/tester.tcl
@@ -199,11 +199,11 @@
199199
regexp -line -- {^project-name: (.*)$} $res dummy projectName
200200
set projectName [string trim $projectName]
201201
regexp -line -- {^local-root: (.*)$} $res dummy localRoot
202202
set localRoot [string trim $localRoot]
203203
error "Detected an open checkout of project \"$projectName\",\
204
-rooted at \"$localRoot\", testing halted"
204
+rooted at \"$localRoot\", testing halted."
205205
}
206206
}
207207
208208
proc get_script_or_fail {} {
209209
set fileName [file normalize [info script]]
@@ -225,11 +225,11 @@
225225
return
226226
}
227227
}
228228
after [expr {$try * 100}]
229229
}
230
- error "cannot delete \"$path\": $error"
230
+ error "Could not delete \"$path\", error: $error"
231231
}
232232
233233
proc test_cleanup {} {
234234
if {![info exists ::tempRepoPath]} {return}
235235
if {![file exists $::tempRepoPath]} {return}
@@ -250,11 +250,16 @@
250250
robust_delete $seedPath; # NO FORCE.
251251
}
252252
# Next, attempt to gracefully delete the temporary repository directory
253253
# for this process.
254254
robust_delete $::tempRepoPath
255
- # Finally, attempt to gracefully delete the temporary home directory.
255
+ # Finally, attempt to gracefully delete the temporary home directory,
256
+ # unless forbidden by external forces.
257
+ if {![info exists ::tempKeepHome]} {delete_temporary_home}
258
+}
259
+
260
+proc delete_temporary_home {} {
256261
if {$::tcl_platform(platform) eq "windows"} {
257262
robust_delete [file join $::tempHomePath _fossil]
258263
} else {
259264
robust_delete [file join $::tempHomePath .fossil]
260265
}
@@ -278,25 +283,29 @@
278283
#
279284
# Create and open a new Fossil repository and clean the checkout
280285
#
281286
proc repo_init {{filename ".rep.fossil"}} {
282287
set_home_to_elsewhere
283
- set ::tempRepoPath [file join $::tempPath repo_[pid]]
288
+ if {![info exists ::tempRepoPath]} {
289
+ set ::tempRepoPath [file join $::tempPath repo_[pid]]
290
+ }
284291
set repoSeed [appendArgs [string trim [clock seconds] -] _ [getSeqNo]]
285292
lappend ::tempRepoSeeds $repoSeed
286293
set repoPath [file join \
287294
$::tempRepoPath $repoSeed [file tail [get_script_or_fail]]]
288295
if {[catch {
289296
file mkdir $repoPath
290297
} error] != 0} {
291
- error "could not make directory \"$repoPath\",\
292
-please set TEMP variable in environment: $error"
298
+ error "Could not make directory \"$repoPath\",\
299
+please set TEMP variable in environment, error: $error"
293300
}
294301
if {![info exists ::tempSavedPwd]} {set ::tempSavedPwd [pwd]}; cd $repoPath
295
- exec $::fossilexe new $filename
296
- exec $::fossilexe open $filename
297
- exec $::fossilexe set mtime-changes off
302
+ if {[string length $filename] > 0} {
303
+ exec $::fossilexe new $filename
304
+ exec $::fossilexe open $filename
305
+ exec $::fossilexe set mtime-changes off
306
+ }
298307
}
299308
300309
# This procedure only returns non-zero if the Tcl integration feature was
301310
# enabled at compile-time and is now enabled at runtime.
302311
proc is_tcl_usable_by_fossil {} {
@@ -595,35 +604,31 @@
595604
596605
if {[catch {
597606
set tempFile [file join $tempPath temporary.txt]
598607
write_file $tempFile [clock seconds]; file delete $tempFile
599608
} error] != 0} {
600
- error "could not write file \"$tempFile\" in directory \"$tempPath\",\
601
-please set TEMP variable in environment: $error"
609
+ error "Could not write file \"$tempFile\" in directory \"$tempPath\",\
610
+please set TEMP variable in environment, error: $error"
602611
}
603612
604613
set tempHomePath [file join $tempPath home_[pid]]
605614
606615
if {[catch {
607616
file mkdir $tempHomePath
608617
} error] != 0} {
609
- error "could not make directory \"$tempHomePath\",\
610
-please set TEMP variable in environment: $error"
618
+ error "Could not make directory \"$tempHomePath\",\
619
+please set TEMP variable in environment, error: $error"
611620
}
612621
613622
protInit $fossilexe
623
+set ::tempKeepHome 1
614624
foreach testfile $argv {
615
- set dir [file root [file tail $testfile]]
616
- file delete -force $dir
617
- file mkdir $dir
618
- set origwd [pwd]
619
- cd $dir
620625
protOut "***** $testfile ******"
621626
source $testdir/$testfile.test
622627
protOut "***** End of $testfile: [llength $bad_test] errors so far ******"
623
- cd $origwd
624628
}
629
+unset ::tempKeepHome; delete_temporary_home
625630
set nErr [llength $bad_test]
626631
if {$nErr>0 || !$::QUIET} {
627632
protOut "***** Final results: $nErr errors out of $test_count tests" 1
628633
}
629634
if {$nErr>0} {
630635
--- test/tester.tcl
+++ test/tester.tcl
@@ -199,11 +199,11 @@
199 regexp -line -- {^project-name: (.*)$} $res dummy projectName
200 set projectName [string trim $projectName]
201 regexp -line -- {^local-root: (.*)$} $res dummy localRoot
202 set localRoot [string trim $localRoot]
203 error "Detected an open checkout of project \"$projectName\",\
204 rooted at \"$localRoot\", testing halted"
205 }
206 }
207
208 proc get_script_or_fail {} {
209 set fileName [file normalize [info script]]
@@ -225,11 +225,11 @@
225 return
226 }
227 }
228 after [expr {$try * 100}]
229 }
230 error "cannot delete \"$path\": $error"
231 }
232
233 proc test_cleanup {} {
234 if {![info exists ::tempRepoPath]} {return}
235 if {![file exists $::tempRepoPath]} {return}
@@ -250,11 +250,16 @@
250 robust_delete $seedPath; # NO FORCE.
251 }
252 # Next, attempt to gracefully delete the temporary repository directory
253 # for this process.
254 robust_delete $::tempRepoPath
255 # Finally, attempt to gracefully delete the temporary home directory.
 
 
 
 
 
256 if {$::tcl_platform(platform) eq "windows"} {
257 robust_delete [file join $::tempHomePath _fossil]
258 } else {
259 robust_delete [file join $::tempHomePath .fossil]
260 }
@@ -278,25 +283,29 @@
278 #
279 # Create and open a new Fossil repository and clean the checkout
280 #
281 proc repo_init {{filename ".rep.fossil"}} {
282 set_home_to_elsewhere
283 set ::tempRepoPath [file join $::tempPath repo_[pid]]
 
 
284 set repoSeed [appendArgs [string trim [clock seconds] -] _ [getSeqNo]]
285 lappend ::tempRepoSeeds $repoSeed
286 set repoPath [file join \
287 $::tempRepoPath $repoSeed [file tail [get_script_or_fail]]]
288 if {[catch {
289 file mkdir $repoPath
290 } error] != 0} {
291 error "could not make directory \"$repoPath\",\
292 please set TEMP variable in environment: $error"
293 }
294 if {![info exists ::tempSavedPwd]} {set ::tempSavedPwd [pwd]}; cd $repoPath
295 exec $::fossilexe new $filename
296 exec $::fossilexe open $filename
297 exec $::fossilexe set mtime-changes off
 
 
298 }
299
300 # This procedure only returns non-zero if the Tcl integration feature was
301 # enabled at compile-time and is now enabled at runtime.
302 proc is_tcl_usable_by_fossil {} {
@@ -595,35 +604,31 @@
595
596 if {[catch {
597 set tempFile [file join $tempPath temporary.txt]
598 write_file $tempFile [clock seconds]; file delete $tempFile
599 } error] != 0} {
600 error "could not write file \"$tempFile\" in directory \"$tempPath\",\
601 please set TEMP variable in environment: $error"
602 }
603
604 set tempHomePath [file join $tempPath home_[pid]]
605
606 if {[catch {
607 file mkdir $tempHomePath
608 } error] != 0} {
609 error "could not make directory \"$tempHomePath\",\
610 please set TEMP variable in environment: $error"
611 }
612
613 protInit $fossilexe
 
614 foreach testfile $argv {
615 set dir [file root [file tail $testfile]]
616 file delete -force $dir
617 file mkdir $dir
618 set origwd [pwd]
619 cd $dir
620 protOut "***** $testfile ******"
621 source $testdir/$testfile.test
622 protOut "***** End of $testfile: [llength $bad_test] errors so far ******"
623 cd $origwd
624 }
 
625 set nErr [llength $bad_test]
626 if {$nErr>0 || !$::QUIET} {
627 protOut "***** Final results: $nErr errors out of $test_count tests" 1
628 }
629 if {$nErr>0} {
630
--- test/tester.tcl
+++ test/tester.tcl
@@ -199,11 +199,11 @@
199 regexp -line -- {^project-name: (.*)$} $res dummy projectName
200 set projectName [string trim $projectName]
201 regexp -line -- {^local-root: (.*)$} $res dummy localRoot
202 set localRoot [string trim $localRoot]
203 error "Detected an open checkout of project \"$projectName\",\
204 rooted at \"$localRoot\", testing halted."
205 }
206 }
207
208 proc get_script_or_fail {} {
209 set fileName [file normalize [info script]]
@@ -225,11 +225,11 @@
225 return
226 }
227 }
228 after [expr {$try * 100}]
229 }
230 error "Could not delete \"$path\", error: $error"
231 }
232
233 proc test_cleanup {} {
234 if {![info exists ::tempRepoPath]} {return}
235 if {![file exists $::tempRepoPath]} {return}
@@ -250,11 +250,16 @@
250 robust_delete $seedPath; # NO FORCE.
251 }
252 # Next, attempt to gracefully delete the temporary repository directory
253 # for this process.
254 robust_delete $::tempRepoPath
255 # Finally, attempt to gracefully delete the temporary home directory,
256 # unless forbidden by external forces.
257 if {![info exists ::tempKeepHome]} {delete_temporary_home}
258 }
259
260 proc delete_temporary_home {} {
261 if {$::tcl_platform(platform) eq "windows"} {
262 robust_delete [file join $::tempHomePath _fossil]
263 } else {
264 robust_delete [file join $::tempHomePath .fossil]
265 }
@@ -278,25 +283,29 @@
283 #
284 # Create and open a new Fossil repository and clean the checkout
285 #
286 proc repo_init {{filename ".rep.fossil"}} {
287 set_home_to_elsewhere
288 if {![info exists ::tempRepoPath]} {
289 set ::tempRepoPath [file join $::tempPath repo_[pid]]
290 }
291 set repoSeed [appendArgs [string trim [clock seconds] -] _ [getSeqNo]]
292 lappend ::tempRepoSeeds $repoSeed
293 set repoPath [file join \
294 $::tempRepoPath $repoSeed [file tail [get_script_or_fail]]]
295 if {[catch {
296 file mkdir $repoPath
297 } error] != 0} {
298 error "Could not make directory \"$repoPath\",\
299 please set TEMP variable in environment, error: $error"
300 }
301 if {![info exists ::tempSavedPwd]} {set ::tempSavedPwd [pwd]}; cd $repoPath
302 if {[string length $filename] > 0} {
303 exec $::fossilexe new $filename
304 exec $::fossilexe open $filename
305 exec $::fossilexe set mtime-changes off
306 }
307 }
308
309 # This procedure only returns non-zero if the Tcl integration feature was
310 # enabled at compile-time and is now enabled at runtime.
311 proc is_tcl_usable_by_fossil {} {
@@ -595,35 +604,31 @@
604
605 if {[catch {
606 set tempFile [file join $tempPath temporary.txt]
607 write_file $tempFile [clock seconds]; file delete $tempFile
608 } error] != 0} {
609 error "Could not write file \"$tempFile\" in directory \"$tempPath\",\
610 please set TEMP variable in environment, error: $error"
611 }
612
613 set tempHomePath [file join $tempPath home_[pid]]
614
615 if {[catch {
616 file mkdir $tempHomePath
617 } error] != 0} {
618 error "Could not make directory \"$tempHomePath\",\
619 please set TEMP variable in environment, error: $error"
620 }
621
622 protInit $fossilexe
623 set ::tempKeepHome 1
624 foreach testfile $argv {
 
 
 
 
 
625 protOut "***** $testfile ******"
626 source $testdir/$testfile.test
627 protOut "***** End of $testfile: [llength $bad_test] errors so far ******"
 
628 }
629 unset ::tempKeepHome; delete_temporary_home
630 set nErr [llength $bad_test]
631 if {$nErr>0 || !$::QUIET} {
632 protOut "***** Final results: $nErr errors out of $test_count tests" 1
633 }
634 if {$nErr>0} {
635
--- test/th1-docs.test
+++ test/th1-docs.test
@@ -15,10 +15,12 @@
1515
#
1616
############################################################################
1717
#
1818
# TH1 Docs
1919
#
20
+
21
+repo_init ""
2022
2123
fossil test-th-eval "hasfeature th1Docs"
2224
2325
if {$::RESULT ne "1"} {
2426
puts "Fossil was not compiled with TH1 docs support."; return
2527
--- test/th1-docs.test
+++ test/th1-docs.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # TH1 Docs
19 #
 
 
20
21 fossil test-th-eval "hasfeature th1Docs"
22
23 if {$::RESULT ne "1"} {
24 puts "Fossil was not compiled with TH1 docs support."; return
25
--- test/th1-docs.test
+++ test/th1-docs.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # TH1 Docs
19 #
20
21 repo_init ""
22
23 fossil test-th-eval "hasfeature th1Docs"
24
25 if {$::RESULT ne "1"} {
26 puts "Fossil was not compiled with TH1 docs support."; return
27
--- test/utf.test
+++ test/utf.test
@@ -15,10 +15,12 @@
1515
#
1616
############################################################################
1717
#
1818
# Test UTF-8/UTF-16 detection
1919
#
20
+
21
+repo_init ""
2022
2123
proc swap_byte_order {str} {
2224
set result ""
2325
for {set i 0} {$i < [string length $str]} {incr i} {
2426
set c [scan [string index $str $i] %c]
2527
--- test/utf.test
+++ test/utf.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Test UTF-8/UTF-16 detection
19 #
 
 
20
21 proc swap_byte_order {str} {
22 set result ""
23 for {set i 0} {$i < [string length $str]} {incr i} {
24 set c [scan [string index $str $i] %c]
25
--- test/utf.test
+++ test/utf.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # Test UTF-8/UTF-16 detection
19 #
20
21 repo_init ""
22
23 proc swap_byte_order {str} {
24 set result ""
25 for {set i 0} {$i < [string length $str]} {incr i} {
26 set c [scan [string index $str $i] %c]
27

Keyboard Shortcuts

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