Diff
Not logged in

Differences From Artifact [1515792dce]:

To Artifact [5ad7853e1f]:


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
# Copyright (c) 2006      ActiveState
#
# 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.47.2.1 2008/06/16 20:44:32 andreas_kupries Exp $

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest 2
    namespace import -force ::tcltest::*
}

# Set up namespaces needed to test operation of "info args", "info body",







|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
# Copyright (c) 2006      ActiveState
#
# 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.47.2.2 2008/07/23 20:47:33 andreas_kupries Exp $

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest 2
    namespace import -force ::tcltest::*
}

# Set up namespaces needed to test operation of "info args", "info body",
1294
1295
1296
1297
1298
1299
1300


























1301
1302
1303
1304
1305
1306
1307
    if {*}"\n{1}\n{info frame 0}"
}
test info-33.3a {{*}, literal, not simple, bytecompiled} {
    reduce [foo::bar]
} {type eval line 1 cmd {info frame 0} proc ::foo::bar level 0}

namespace delete foo



























# -------------------------------------------------------------------------

# cleanup
catch {namespace delete test_ns_info1 test_ns_info2}
::tcltest::cleanupTests
return







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
    if {*}"\n{1}\n{info frame 0}"
}
test info-33.3a {{*}, literal, not simple, bytecompiled} {
    reduce [foo::bar]
} {type eval line 1 cmd {info frame 0} proc ::foo::bar level 0}

namespace delete foo

# -------------------------------------------------------------------------

test info-34.0 {eval pure list, single line} {
    # Basically, counting the newline in the word seen through $foo
    # doesn't really make sense. It makes a bit of sense if the word
    # would have been a string literal in the command list.
    #
    # Problem: At the point where we see the list elements we cannot
    # distinguish the two cases, thus we cannot switch between
    # count/not-count, it is has to be one or the other for all
    # cases. Of the two possibilities miguel convinced me that 'not
    # counting' is the more proper.
    set foo {b
	c}
    set cmd [list foreach $foo {x y} {
	set res [join [lrange [etrace] 0 2] \n]
	break
    }]
    eval $cmd
    set res
} {10 {type source line 728 file info.test cmd {info frame $level} proc ::etrace level 0}
9 {type eval line 2 cmd etrace proc ::tcltest::RunTest}
8 {type eval line 1 cmd foreac proc ::tcltest::RunTest}}

# -------------------------------------------------------------------------

# -------------------------------------------------------------------------

# cleanup
catch {namespace delete test_ns_info1 test_ns_info2}
::tcltest::cleanupTests
return