OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tcl/] [tests/] [misc.test] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# Commands covered:  various
2
#
3
# This file contains a collection of miscellaneous Tcl tests that
4
# don't fit naturally in any of the other test files.  Many of these
5
# tests are pathological cases that caused bugs in earlier Tcl
6
# releases.
7
#
8
# Copyright (c) 1992-1993 The Regents of the University of California.
9
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
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
# RCS: @(#) $Id: misc.test,v 1.1.1.1 2002-01-16 10:25:36 markom Exp $
15
 
16
if {[string compare test [info procs test]] == 1} then {source defs}
17
 
18
test misc-1.1 {error in variable ref. in command in array reference} {
19
    proc tstProc {} {
20
        global a
21
 
22
        set tst $a([winfo name $zz])
23
        # this is a bogus comment
24
        # this is a bogus comment
25
        # this is a bogus comment
26
        # this is a bogus comment
27
        # this is a bogus comment
28
        # this is a bogus comment
29
        # this is a bogus comment
30
        # this is a bogus comment
31
    }
32
    set msg {}
33
    list [catch tstProc msg] $msg
34
} {1 {can't read "zz": no such variable}}
35
test misc-1.2 {error in variable ref. in command in array reference} {
36
    proc tstProc {} "
37
        global a
38
 
39
        set tst \$a(\[winfo name \$\{zz)
40
        # this is a bogus comment
41
        # this is a bogus comment
42
        # this is a bogus comment
43
        # this is a bogus comment
44
        # this is a bogus comment
45
        # this is a bogus comment
46
        # this is a bogus comment
47
        # this is a bogus comment
48
    "
49
    set msg {}
50
    list [catch tstProc msg] $msg $errorInfo
51
} {1 {missing close-bracket or close-brace} missing\ close-bracket\ or\ close-brace\n\ \ \ \ while\ compiling\n\"set\ tst\ \$a(\[winfo\ name\ \$\{zz)\"\n\ \ \ \ (compiling\ body\ of\ proc\ \"tstProc\",\ line\ 4)\n\ \ \ \ invoked\ from\ within\n\"tstProc\"}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.