Debian Codegraph @

tests/pwd.test

raw
1 # Commands covered: pwd
2 #
3 # This file contains a collection of tests for one or more of the Tcl
4 # built-in commands. Sourcing this file into Tcl runs the tests and
5 # generates output for errors. No output means no errors were found.
6 #
7 # Copyright (c) 1991-1993 The Regents of the University of California.
8 # Copyright (c) 1994-1997 Sun Microsystems, Inc.
9 # Copyright (c) 1998-1999 by Scriptics Corporation.
10 #
11 # See the file "license.terms" for information on usage and redistribution
12 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13
14 if {"::tcltest" ni [namespace children]} {
15 package require tcltest 2.5
16 namespace import -force ::tcltest::*
17 }
18
19 test pwd-1.1 {simple pwd} {
20 catch pwd
21 } 0
22 test pwd-1.2 {simple pwd} {
23 expr {[string length [pwd]]>0}
24 } 1
25
26 test pwd-2.1 {pwd takes no args} -body {
27 pwd foobar
28 } -returnCodes error -result "wrong \# args: should be \"pwd\""
29
30 # cleanup
31 ::tcltest::cleanupTests
32 return