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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tcl/] [tests/] [eval.test] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# Commands covered:  eval
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 Sun Microsystems, Inc.
9
#
10
# See the file "license.terms" for information on usage and redistribution
11
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
12
#
13
# RCS: @(#) $Id: eval.test,v 1.1.1.1 2002-01-16 10:25:35 markom Exp $
14
 
15
if {[string compare test [info procs test]] == 1} then {source defs}
16
 
17
test eval-1.1 {single argument} {
18
    eval {format 22}
19
} 22
20
test eval-1.2 {multiple arguments} {
21
    set a {$b}
22
    set b xyzzy
23
    eval format $a
24
} xyzzy
25
test eval-1.3 {single argument} {
26
    eval concat a b c d e f g
27
} {a b c d e f g}
28
 
29
test eval-2.1 {error: not enough arguments} {catch eval} 1
30
test eval-2.2 {error: not enough arguments} {
31
    catch eval msg
32
    set msg
33
} {wrong # args: should be "eval arg ?arg ...?"}
34
test eval-2.3 {error in eval'ed command} {
35
    catch {eval {error "test error"}}
36
} 1
37
test eval-2.4 {error in eval'ed command} {
38
    catch {eval {error "test error"}} msg
39
    set msg
40
} {test error}
41
test eval-2.5 {error in eval'ed command: setting errorInfo} {
42
    catch {eval {
43
        set a 1
44
        error "test error"
45
    }} msg
46
    set errorInfo
47
} "test error
48
    while executing
49
\"error \"test error\"\"
50
    (\"eval\" body line 3)
51
    invoked from within
52
\"eval {
53
        set a 1
54
        error \"test error\"
55
    }\""

powered by: WebSVN 2.1.0

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