summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2002-04-26 08:43:38 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2002-04-26 08:43:38 (GMT)
commitb9fd87e9f82e6795e565386564b6e479a49fed8b (patch)
treec12260f9860b76cc2c6cee8c04190b5b5042c834
parentc8e99da5d0319a457285611fac52310c44d51a17 (diff)
downloadtcl-b9fd87e9f82e6795e565386564b6e479a49fed8b.zip
tcl-b9fd87e9f82e6795e565386564b6e479a49fed8b.tar.gz
tcl-b9fd87e9f82e6795e565386564b6e479a49fed8b.tar.bz2
Added more thorough tests for handling of conversion to boolean.
-rw-r--r--ChangeLog2
-rw-r--r--tests/obj.test14
2 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c769e48..8955a24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2002-04-26 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+ * tests/obj.test (obj-11.[56]): Test conversion to boolean more
+ thoroughly.
* generic/tclObj.c (SetBooleanFromAny): Was not calling an integer
parsing function on native 64-bit platforms! [Bug 548686]
diff --git a/tests/obj.test b/tests/obj.test
index 8512049..c4ec7d4 100644
--- a/tests/obj.test
+++ b/tests/obj.test
@@ -11,7 +11,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: obj.test,v 1.6 2001/11/14 23:16:36 hobbs Exp $
+# RCS: @(#) $Id: obj.test,v 1.7 2002/04/26 08:43:38 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -197,6 +197,18 @@ test obj-11.4 {Tcl_GetBooleanFromObj, error converting from "empty string"} {
lappend result [catch {testbooleanobj not 1} msg]
lappend result $msg
} {{} 1 {expected boolean value but got ""}}
+test obj-11.5 {Tcl_GetBooleanFromObj, convert hex to boolean} {
+ set result ""
+ lappend result [teststringobj set 1 0xac]
+ lappend result [testbooleanobj not 1]
+ lappend result [testobj type 1]
+} {0xac 0 boolean}
+test obj-11.6 {Tcl_GetBooleanFromObj, convert float to boolean} {
+ set result ""
+ lappend result [teststringobj set 1 5.42]
+ lappend result [testbooleanobj not 1]
+ lappend result [testobj type 1]
+} {5.42 0 boolean}
test obj-12.1 {DupBooleanInternalRep} {
set result ""