home *** CD-ROM | disk | FTP | other *** search
/ Ultra Pack / UltraComputing Partner Applications.iso / SunLabs / tclTK / src / tcl7.4 / tests / join.test < prev    next >
Encoding:
Text File  |  1994-12-18  |  1.2 KB  |  39 lines

  1. # 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. # @(#) join.test 1.5 94/12/17 16:20:04
  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.