summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2015-06-22 12:40:27 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2015-06-22 12:40:27 (GMT)
commitf7d1196f8c6d4e93379fabf4b83c946c331790c7 (patch)
tree0da92988a85a0d74973000accd9d27e016c761f3 /tests
parent97895a4fdceee8f6b1eaea4253bb6dbffb9c9360 (diff)
parentaf46fd5b12c1265e04beeab0871ce9207e86c7a9 (diff)
downloadtcl-f7d1196f8c6d4e93379fabf4b83c946c331790c7.zip
tcl-f7d1196f8c6d4e93379fabf4b83c946c331790c7.tar.gz
tcl-f7d1196f8c6d4e93379fabf4b83c946c331790c7.tar.bz2
Merge trunk
Diffstat (limited to 'tests')
-rw-r--r--tests/execute.test14
-rw-r--r--tests/expr.test4
-rw-r--r--tests/lreplace.test37
-rw-r--r--tests/thread.test6
4 files changed, 57 insertions, 4 deletions
diff --git a/tests/execute.test b/tests/execute.test
index 94af158..aaf4bc0 100644
--- a/tests/execute.test
+++ b/tests/execute.test
@@ -1043,6 +1043,20 @@ test execute-11.1 {Bug 3142026: GrowEvaluationStack off-by-one} -setup {
} -cleanup {
interp delete slave
} -result ok
+
+test execute-11.2 {Bug 268b23df11} -setup {
+ proc zero {} {return 0}
+ proc crash {} {expr {abs([zero])}}
+ proc noop args {}
+ trace add execution crash enterstep noop
+} -body {
+ crash
+} -cleanup {
+ trace remove execution crash enterstep noop
+ rename noop {}
+ rename crash {}
+ rename zero {}
+} -result 0
# cleanup
if {[info commands testobj] != {}} {
diff --git a/tests/expr.test b/tests/expr.test
index 6ad7208..4c03262 100644
--- a/tests/expr.test
+++ b/tests/expr.test
@@ -7174,6 +7174,10 @@ test expr-50.1 {test sqrt() of bignums with non-Inf answer} {
expr {sqrt("1[string repeat 0 616]") == 1e308}
} 1
+test expr-51.1 {test round-to-even on input} {
+ expr 6.9294956446009195e15
+} 6929495644600920.0
+
# cleanup
diff --git a/tests/lreplace.test b/tests/lreplace.test
index d1319c6..e66a331 100644
--- a/tests/lreplace.test
+++ b/tests/lreplace.test
@@ -133,7 +133,6 @@ test lreplace-3.1 {lreplace won't modify shared argument objects} {
test lreplace-4.1 {Bug ccc2c2cc98: lreplace edge case} {
lreplace {} 1 1
} {}
-# Note that this test will fail in 8.5
test lreplace-4.2 {Bug ccc2c2cc98: lreplace edge case} {
lreplace { } 1 1
} {}
@@ -146,6 +145,42 @@ test lreplace-4.4 {lreplace edge case} {
test lreplace-4.5 {lreplace edge case} {
lreplace {1 2 3 4 5} 3 0 _
} {1 2 3 _ 4 5}
+test lreplace-4.6 {lreplace end-x: bug a4cb3f06c4} {
+ lreplace {0 1 2 3 4} 0 end-2
+} {3 4}
+test lreplace-4.6.1 {lreplace end-x: bug a4cb3f06c4} {
+ lreplace {0 1 2 3 4} 0 end-2 a b c
+} {a b c 3 4}
+test lreplace-4.7 {lreplace with two end-indexes: increasing} {
+ lreplace {0 1 2 3 4} end-2 end-1
+} {0 1 4}
+test lreplace-4.7.1 {lreplace with two end-indexes: increasing} {
+ lreplace {0 1 2 3 4} end-2 end-1 a b c
+} {0 1 a b c 4}
+test lreplace-4.8 {lreplace with two end-indexes: equal} {
+ lreplace {0 1 2 3 4} end-2 end-2
+} {0 1 3 4}
+test lreplace-4.8.1 {lreplace with two end-indexes: equal} {
+ lreplace {0 1 2 3 4} end-2 end-2 a b c
+} {0 1 a b c 3 4}
+test lreplace-4.9 {lreplace with two end-indexes: decreasing} {
+ lreplace {0 1 2 3 4} end-2 end-3
+} {0 1 2 3 4}
+test lreplace-4.9.1 {lreplace with two end-indexes: decreasing} {
+ lreplace {0 1 2 3 4} end-2 end-3 a b c
+} {0 1 a b c 2 3 4}
+test lreplace-4.10 {lreplace with two equal indexes} {
+ lreplace {0 1 2 3 4} 2 2
+} {0 1 3 4}
+test lreplace-4.10.1 {lreplace with two equal indexes} {
+ lreplace {0 1 2 3 4} 2 2 a b c
+} {0 1 a b c 3 4}
+test lreplace-4.11 {lreplace end index first} {
+ lreplace {0 1 2 3 4} end-2 1 a b c
+} {0 1 a b c 2 3 4}
+test lreplace-4.12 {lreplace end index first} {
+ lreplace {0 1 2 3 4} end-2 2 a b c
+} {0 1 a b c 3 4}
# cleanup
catch {unset foo}
diff --git a/tests/thread.test b/tests/thread.test
index f32ef61..6032bae 100644
--- a/tests/thread.test
+++ b/tests/thread.test
@@ -564,7 +564,7 @@ test thread-7.14 {cancel: vwait} -constraints {thread drainEventQueue} -setup {
unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted
} -body {
set serverthread [thread::create -joinable \
- [string map [list %ID [thread::id]] {
+ [string map [list %ID% [thread::id]] {
if {![info exists foo]} then {
# signal the primary thread that we are ready
# to be canceled now (we are running).
@@ -616,7 +616,7 @@ test thread-7.16 {cancel: expr} -constraints {thread drainEventQueue} -setup {
unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted
} -body {
set serverthread [thread::create -joinable \
- [string map [list %ID [thread::id]] {
+ [string map [list %ID% [thread::id]] {
set i [interp create]
$i eval "package require -exact Thread [package present Thread]"
$i eval {
@@ -1372,7 +1372,7 @@ test thread-7.37 {cancel: send async thread cancel nested catch inside pure insi
unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted
} -body {
set serverthread [thread::create -joinable \
- [string map [list %ID [thread::id]] {
+ [string map [list %ID% [thread::id]] {
proc foobar {} {
set catch catch
set while while