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

Subversion Repositories or1k

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# Commands covered:  unknown
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: unknown.test,v 1.1.1.1 2002-01-16 10:25:36 markom Exp $
14
 
15
if {[string compare test [info procs test]] == 1} then {source defs}
16
 
17
catch {unset x}
18
catch {rename unknown unknown.old}
19
 
20
test unknown-1.1 {non-existent "unknown" command} {
21
    list [catch {_non-existent_ foo bar} msg] $msg
22
} {1 {invalid command name "_non-existent_"}}
23
 
24
proc unknown {args} {
25
    global x
26
    set x $args
27
}
28
 
29
test unknown-2.1 {calling "unknown" command} {
30
    foobar x y z
31
    set x
32
} {foobar x y z}
33
test unknown-2.2 {calling "unknown" command with lots of args} {
34
    foobar 1 2 3 4 5 6 7
35
    set x
36
} {foobar 1 2 3 4 5 6 7}
37
test unknown-2.3 {calling "unknown" command with lots of args} {
38
    foobar 1 2 3 4 5 6 7 8
39
    set x
40
} {foobar 1 2 3 4 5 6 7 8}
41
test unknown-2.4 {calling "unknown" command with lots of args} {
42
    foobar 1 2 3 4 5 6 7 8 9
43
    set x
44
} {foobar 1 2 3 4 5 6 7 8 9}
45
 
46
test unknown-3.1 {argument quoting in calls to "unknown"} {
47
    foobar \{ \} a\{b \; "\\" \$a a\[b \]
48
    set x
49
} "foobar \\{ \\} a\\{b {;} \\\\ {\$a} {a\[b} \\]"
50
 
51
proc unknown args {
52
    error "unknown failed"
53
}
54
 
55
test unknown-4.1 {errors in "unknown" procedure} {
56
    list [catch {non-existent a b} msg] $msg $errorCode
57
} {1 {unknown failed} NONE}
58
 
59
catch {rename unknown {}}
60
catch {rename unknown.old unknown}
61
return {}

powered by: WebSVN 2.1.0

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