summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2001-04-09 09:48:41 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2001-04-09 09:48:41 (GMT)
commit32c13b3778a26251f9c69ccc78007c9c1c9a21de (patch)
tree6417353e84ce8af8bb2b71b7b022d88fb6f9a359 /tests
parentb2a008bec7dcd0a3668e07ba075f89bb68d7b2d8 (diff)
downloadtcl-32c13b3778a26251f9c69ccc78007c9c1c9a21de.zip
tcl-32c13b3778a26251f9c69ccc78007c9c1c9a21de.tar.gz
tcl-32c13b3778a26251f9c69ccc78007c9c1c9a21de.tar.bz2
Recognise the non-numeric boolean literals (true,false,yes,no,on,off.)
[Bug #217777]
Diffstat (limited to 'tests')
-rw-r--r--tests/expr.test16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/expr.test b/tests/expr.test
index 05b8f9d..b4487e3 100644
--- a/tests/expr.test
+++ b/tests/expr.test
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: expr.test,v 1.11 2000/11/24 15:14:01 dkf Exp $
+# RCS: @(#) $Id: expr.test,v 1.12 2001/04/09 09:48:41 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -753,6 +753,20 @@ test expr-20.7 {handling of compile error in runtime case} {
list [catch {expr + {[error foo]}} msg] $msg
} {1 foo}
+# Test for non-numeric boolean literal handling
+test expr-21.1 {non-numeric boolean literals} {expr false } false
+test expr-21.2 {non-numeric boolean literals} {expr true } true
+test expr-21.3 {non-numeric boolean literals} {expr off } off
+test expr-21.4 {non-numeric boolean literals} {expr on } on
+test expr-21.5 {non-numeric boolean literals} {expr no } no
+test expr-21.6 {non-numeric boolean literals} {expr yes } yes
+test expr-21.7 {non-numeric boolean literals} {expr !false} 1
+test expr-21.8 {non-numeric boolean literals} {expr !true } 0
+test expr-21.9 {non-numeric boolean literals} {expr !off } 1
+test expr-21.10 {non-numeric boolean literals} {expr !on } 0
+test expr-21.11 {non-numeric boolean literals} {expr !no } 1
+test expr-21.12 {non-numeric boolean literals} {expr !yes } 0
+
# cleanup
if {[info exists a]} {
unset a