1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
-
+
|
# Commands covered: info
#
# This file contains a collection of tests for one or more of the Tcl
# built-in commands. Sourcing this file into Tcl runs the tests and
# generates output for errors. No output means no errors were found.
#
# Copyright (c) 1991-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: info.test,v 1.15 2000/04/10 17:19:00 ericm Exp $
# RCS: @(#) $Id: info.test,v 1.15.2.1 2002/04/18 18:15:27 msofer Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
namespace import -force ::tcltest::*
}
# Set up namespaces needed to test operation of "info args", "info body",
|
326
327
328
329
330
331
332
333
334
335
336
337
338
339
|
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
|
+
+
+
+
+
|
proc t1 {} {info level -1}
list [catch {t1} msg] $msg
} {1 {bad level "-1"}}
test info-9.9 {info level option} {
proc t1 {x} {info level $x}
list [catch {t1 -3} msg] $msg
} {1 {bad level "-3"}}
test info-9.10 {info level option, namespaces} {
set msg [namespace eval t {info level 0}]
namespace delete t
set msg
} {namespace eval t {info level 0}}
set savedLibrary $tcl_library
test info-10.1 {info library option} {
list [catch {info library x} msg] $msg
} {1 {wrong # args: should be "info library"}}
test info-10.2 {info library option} {
set tcl_library 12345
|