diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-10-04 16:06:01 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-10-04 16:06:01 (GMT) |
commit | 7a0c0b20340a1a22093e6a1496834724276a5292 (patch) | |
tree | bf3a623a9e38a4207184d387244a002f921461b4 /tests | |
parent | d03849d2cd49e3ee0b2846111d0c314f5dc31813 (diff) | |
parent | ca8b1a6887a577656091a540238902dac5791f4a (diff) | |
download | tcl-7a0c0b20340a1a22093e6a1496834724276a5292.zip tcl-7a0c0b20340a1a22093e6a1496834724276a5292.tar.gz tcl-7a0c0b20340a1a22093e6a1496834724276a5292.tar.bz2 |
Merge 9.0
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lseq.test | 17 | ||||
-rw-r--r-- | tests/parse.test | 6 | ||||
-rw-r--r-- | tests/parseExpr.test | 4 |
3 files changed, 20 insertions, 7 deletions
diff --git a/tests/lseq.test b/tests/lseq.test index 3d9988e..8bd8114 100644 --- a/tests/lseq.test +++ b/tests/lseq.test @@ -223,6 +223,8 @@ test lseq-3.1 {experiement} { if {$ans eq {}} { set ans OK } + unset factor + unset l set ans } {OK} @@ -376,13 +378,18 @@ test lseq-3.26 {lsort shimmer} arithSeriesShimmer { list ${rep-before} $lexical_sort ${rep-after} } {arithseries {0 1 10 11 12 13 14 15 2 3 4 5 6 7 8 9} arithseries} -test lseq-3.27 {lreplace shimmer} arithSeriesShimmer { +test lseq-3.27 {lreplace shimmer} -constraints arithSeriesShimmer -body { set r [lseq 15 0] set rep-before [lindex [tcl::unsupported::representation $r] 3] set lexical_sort [lreplace $r 3 5 A B C] set rep-after [lindex [tcl::unsupported::representation $r] 3] list ${rep-before} $lexical_sort ${rep-after} -} {arithseries {15 14 13 A B C 9 8 7 6 5 4 3 2 1 0} arithseries} +} -cleanup { + unset r + unset rep-before + unset lexical_sort + unset rep-after +} -result {arithseries {15 14 13 A B C 9 8 7 6 5 4 3 2 1 0} arithseries} test lseq-3.28 {lreverse bug in ArithSeries} {} { set r [lseq -5 17 3] @@ -502,9 +509,15 @@ test lseq-4.5 {lindex off by one} -body { unset res } -result {4 3} +# Panic when using variable value? +test lseq-4.6 {panic using variable index} { + set i 0 + lindex [lseq 10] $i +} {0} # cleanup ::tcltest::cleanupTests + return # Local Variables: diff --git a/tests/parse.test b/tests/parse.test index 5b38318..517d577 100644 --- a/tests/parse.test +++ b/tests/parse.test @@ -601,8 +601,8 @@ test parse-12.6 {Tcl_ParseVarName procedure, braced variable name} testparser { testparser {${..[]b}cd} 0 } {- {${..[]b}cd} 1 word {${..[]b}cd} 3 variable {${..[]b}} 1 text {..[]b} 0 text cd 0 {}} test parse-12.7 {Tcl_ParseVarName procedure, braced variable name} testparser { - testparser "\$\{\{\} " 0 -} {- \$\{\{\}\ 1 word \$\{\{\} 2 variable \$\{\{\} 1 text \{ 0 {}} + testparser "\$\{\{\\\\\}\} " 0 +} {- {${{\\}} } 1 word {${{\\}}} 2 variable {${{\\}}} 1 text {{\\}} 0 {}} test parse-12.8 {Tcl_ParseVarName procedure, missing close brace} testparser { list [catch {testparser "$\{abc" 0} msg] $msg $::errorInfo } {1 {missing close-brace for variable name} missing\ close-brace\ for\ variable\ name\n\ \ \ \ (remainder\ of\ script:\ \"\{abc\")\n\ \ \ \ invoked\ from\ within\n\"testparser\ \"\$\\\{abc\"\ 0\"} @@ -797,7 +797,7 @@ test parse-15.16 {CommandComplete procedure} { } 1 test parse-15.17 {CommandComplete procedure} { info complete {a b "c $dd("} -} 0 +} 1 test parse-15.18 {CommandComplete procedure} { info complete {a b "c \"} } 0 diff --git a/tests/parseExpr.test b/tests/parseExpr.test index c70c5e3..b9245ce 100644 --- a/tests/parseExpr.test +++ b/tests/parseExpr.test @@ -919,8 +919,8 @@ test parseExpr-21.43 {error message} -body { in expression \"...8901234567890*\"foobar\$\{abcdefghijklmnopqrstuv...\"" test parseExpr-21.44 {error message} -body { expr {123456789012345678901234567890*"foo$bar(abcdefghijklmnopqrstuvwxyz"} -} -returnCodes error -result {missing ) -in expression "...8901234567890*"foo$bar(abcdefghijklmnopqrstuv..."} +} -returnCodes error -result {invalid character in array index +in expression "...8901234567890*"foo$bar(abcdefghijklmnopqrstu..."} test parseExpr-21.45 {error message} -body { expr {123456789012345678901234567890*"foo$bar([{}abcdefghijklmnopqrstuvwxyz])"} } -returnCodes error -result {extra characters after close-brace |