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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tcl/] [tests/] [join.test] - Blame information for rev 1767

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

Line No. Rev Author Line
1 578 markom
# Commands covered:  join
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: join.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
test join-1.1 {basic join commands} {
18
    join {a b c} xyz
19
} axyzbxyzc
20
test join-1.2 {basic join commands} {
21
    join {a b c} {}
22
} abc
23
test join-1.3 {basic join commands} {
24
    join {} xyz
25
} {}
26
test join-1.4 {basic join commands} {
27
    join {12 34 56}
28
} {12 34 56}
29
 
30
test join-2.1 {join errors} {
31
    list [catch join msg] $msg $errorCode
32
} {1 {wrong # args: should be "join list ?joinString?"} NONE}
33
test join-2.2 {join errors} {
34
    list [catch {join a b c} msg] $msg $errorCode
35
} {1 {wrong # args: should be "join list ?joinString?"} NONE}
36
test join-2.3 {join errors} {
37
    list [catch {join "a \{ c" 111} msg] $msg $errorCode
38
} {1 {unmatched open brace in list} NONE}
39
 
40
test join-3.1 {joinString is binary ok} {
41
  string length [join {a b c} a\0b]
42
} 9
43
 
44
test join-3.2 {join is binary ok} {
45
  string length [join "a\0b a\0b a\0b"]
46
} 11
47
 
48
 

powered by: WebSVN 2.1.0

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