summaryrefslogtreecommitdiffstats
path: root/tools/regexpTestLib.tcl
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-07-01 21:28:15 (GMT)
committernijtmans <nijtmans>2010-07-01 21:28:15 (GMT)
commitabb430245e8a99364bb0ddbca7f85c8adb62d36f (patch)
tree6504f41b881faedff35589b0b480a44e4042fb92 /tools/regexpTestLib.tcl
parente10b292750a32db464a69efbd938795b6f2c8d52 (diff)
downloadtcl-abb430245e8a99364bb0ddbca7f85c8adb62d36f.zip
tcl-abb430245e8a99364bb0ddbca7f85c8adb62d36f.tar.gz
tcl-abb430245e8a99364bb0ddbca7f85c8adb62d36f.tar.bz2
[Bug #3020677] wish can't link reg1.2
formatting, spacing, cleanup unused variables
Diffstat (limited to 'tools/regexpTestLib.tcl')
-rw-r--r--tools/regexpTestLib.tcl32
1 files changed, 16 insertions, 16 deletions
diff --git a/tools/regexpTestLib.tcl b/tools/regexpTestLib.tcl
index d43cd4e..b57a71e 100644
--- a/tools/regexpTestLib.tcl
+++ b/tools/regexpTestLib.tcl
@@ -7,7 +7,7 @@
# Copyright (c) 1996 by Sun Microsystems, Inc.
#
# SCCS: @(#) regexpTestLib.tcl 1.4 98/01/22 14:48:34
-#
+#
proc readInputFile {} {
global inFileName
@@ -46,7 +46,7 @@ proc readInputFile {} {
#
# strings with embedded @'s are truncated
# unpreceeded @'s are replaced by {}
-#
+#
proc removeAts {ls} {
set len [llength $ls]
set newLs {}
@@ -97,7 +97,7 @@ proc writeOutputFile {numLines fcn} {
global outFileName
global lineArray
- # open output file and write file header info to it.
+ # open output file and write file header info to it.
set fileId [open $outFileName w]
@@ -136,7 +136,7 @@ proc writeOutputFile {numLines fcn} {
puts $fileId $currentLine
incr srcLineNum $lineArray(c$lineNum)
incr lineNum
- continue
+ continue
}
set len [llength $currentLine]
@@ -147,7 +147,7 @@ proc writeOutputFile {numLines fcn} {
puts $fileId "\n"
incr srcLineNum $lineArray(c$lineNum)
incr lineNum
- continue
+ continue
}
if {($len < 3)} {
puts "warning: test is too short --\n\t$currentLine"
@@ -212,21 +212,21 @@ proc convertTestLine {currentLine len lineNum srcLineNum} {
set vals {}
set result 0
set v 0
-
+
if {[regsub {\*} "$flags" "" newFlags] == 1} {
# an error is expected
-
+
if {[string compare $str "EMPTY"] == 0} {
# empty regexp is not an error
# skip this test
-
+
return "\# skipping the empty-re test from line $srcLineNum\n"
}
set flags $newFlags
set result "\{1 \{[convertErrCode $str]\}\}"
} elseif {$numVars > 0} {
# at least 1 match is made
-
+
if {[regexp {s} $flags] == 1} {
set result "\{0 1\}"
} else {
@@ -243,7 +243,7 @@ proc convertTestLine {currentLine len lineNum srcLineNum} {
}
} else {
# no match is made
-
+
set result "\{0 0\}"
}
@@ -251,16 +251,16 @@ proc convertTestLine {currentLine len lineNum srcLineNum} {
set cmd [prepareCmd $flags $re $str $vars $noBraces]
if {$cmd == -1} {
- return "\# skipping test with metasyntax from line $srcLineNum\n"
+ return "\# skipping test with metasyntax from line $srcLineNum\n"
}
set test "test regexp-1.$srcLineNum \{converted from line $srcLineNum\} \{\n"
append test "\tcatch {unset var}\n"
- append test "\tlist \[catch \{ \n"
- append test "\t\tset match \[$cmd\] \n"
- append test "\t\tlist \$match $vals \n"
- append test "\t\} msg\] \$msg \n"
- append test "\} $result \n"
+ append test "\tlist \[catch \{\n"
+ append test "\t\tset match \[$cmd\]\n"
+ append test "\t\tlist \$match $vals\n"
+ append test "\t\} msg\] \$msg\n"
+ append test "\} $result\n"
return $test
}