diff options
Diffstat (limited to 'tests/cmdMZ.test')
-rw-r--r-- | tests/cmdMZ.test | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/tests/cmdMZ.test b/tests/cmdMZ.test index fb2ca4a..ef9790f 100644 --- a/tests/cmdMZ.test +++ b/tests/cmdMZ.test @@ -4,16 +4,16 @@ # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # -# Copyright (c) 1991-1993 The Regents of the University of California. -# Copyright (c) 1994 Sun Microsystems, Inc. -# Copyright (c) 1998-1999 by Scriptics Corporation. +# Copyright © 1991-1993 The Regents of the University of California. +# Copyright © 1994 Sun Microsystems, Inc. +# Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. -if {[catch {package require tcltest 2.1}]} { - puts stderr "Skipping tests in [info script]. tcltest 2.1 required." - return +if {"::tcltest" ni [namespace children]} { + package require tcltest 2.5 + namespace import -force ::tcltest::* } namespace eval ::tcl::test::cmdMZ { @@ -25,10 +25,6 @@ namespace eval ::tcl::test::cmdMZ { namespace import ::tcltest::testConstraint namespace import ::tcltest::test - if {[namespace which -command ::tcl::unsupported::timerate] ne ""} { - namespace import ::tcl::unsupported::timerate - } - proc ListGlobMatch {expected actual} { if {[llength $expected] != [llength $actual]} { return 0 @@ -63,7 +59,7 @@ test cmdMZ-1.4 {Tcl_PwdObjCmd: failure} -setup { # This test fails on various unix platforms (eg Linux) where permissions # caching causes this to fail. The caching is strictly incorrect, but we # have no control over that. - file attr . -permissions 0o000 + file attr . -permissions 0 pwd } -returnCodes error -cleanup { cd $cwd @@ -239,7 +235,7 @@ test cmdMZ-3.3 {Tcl_SourceObjCmd: error conditions} -constraints { test cmdMZ-3.4 {Tcl_SourceObjCmd: error conditions} -constraints { unixOrWin } -returnCodes error -body { - source a b + source a b c d e f } -match glob -result {wrong # args: should be "source*fileName"} test cmdMZ-3.5 {Tcl_SourceObjCmd: error in script} -body { set file [makeFile { @@ -321,7 +317,7 @@ test cmdMZ-4.13 {Tcl_SplitObjCmd: basic split commands} { # The tests for Tcl_SubstObjCmd are in subst.test # The tests for Tcl_SwitchObjCmd are in switch.test -# todo: rewrite this if monotonic clock is provided resp. command "after" +# todo: rewrite this if monotonic clock is provided resp. command "after" # gets microsecond accuracy (RFE [fdfbd5e10] gets merged): proc _nrt_sleep {msec} { set usec [expr {$msec * 1000}] @@ -483,6 +479,23 @@ test cmdMZ-6.12 {Tcl_TimeRateObjCmd: done optimization: nested call of self insi list [lindex [timerate $m1 1000 5] 2] $x } {5 20} +test cmdMZ-try-1.0 { + + fix for issue 45b9faf103f2 + + [try] interaction with local variable names produces segmentation violation + +} -body { + ::apply {{} { + set cmd try + $cmd { + lindex 5 + } on ok res {} + set res + }} +} -result 5 + + # The tests for Tcl_WhileObjCmd are in while.test # cleanup |