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

  1. # Commands covered:  concat
  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. # @(#) concat.test 1.7 94/12/17 16:19:47
  14.  
  15. if {[string compare test [info procs test]] == 1} then {source defs}
  16.  
  17. test concat-1.1 {simple concatenation} {
  18.     concat a b c d e f g
  19. } {a b c d e f g}
  20. test concat-1.2 {merging lists together} {
  21.     concat a {b c d} {e f g h}
  22. } {a b c d e f g h}
  23. test concat-1.3 {merge lists, retain sub-lists} {
  24.     concat a {b {c d}} {{e f}} g h
  25. } {a b {c d} {e f} g h}
  26. test concat-1.4 {special characters} {
  27.     concat a\{ {b \{c d} \{d
  28. } "a{ b \\{c d {d"
  29.  
  30. test concat-2.1 {error: no arguments} {
  31.     list [catch concat msg] $msg
  32. } {0 {}}
  33.  
  34. test concat-3.1 {pruning off extra white space} {
  35.     concat {} {a b c}
  36. } {a b c}
  37. test concat-3.2 {pruning off extra white space} {
  38.     concat x y "  a b c    \n\t  " "   "  " def "
  39. } {x y a b c def}
  40.