home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / tcl8.0 / tests / misc.test < prev    next >
Encoding:
Text File  |  1997-08-15  |  1.7 KB  |  52 lines  |  [TEXT/ALFA]

  1. # Commands covered:  various
  2. #
  3. # This file contains a collection of miscellaneous Tcl tests that
  4. # don't fit naturally in any of the other test files.  Many of these
  5. # tests are pathological cases that caused bugs in earlier Tcl
  6. # releases.
  7. #
  8. # Copyright (c) 1992-1993 The Regents of the University of California.
  9. # Copyright (c) 1994-1996 Sun Microsystems, Inc.
  10. #
  11. # See the file "license.terms" for information on usage and redistribution
  12. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  13. #
  14. # SCCS: @(#) misc.test 1.12 97/07/02 16:41:34
  15.  
  16. if {[string compare test [info procs test]] == 1} then {source defs}
  17.  
  18. test misc-1.1 {error in variable ref. in command in array reference} {
  19.     proc tstProc {} {
  20.     global a
  21.     
  22.     set tst $a([winfo name $zz])
  23.     # this is a bogus comment
  24.     # this is a bogus comment
  25.     # this is a bogus comment
  26.     # this is a bogus comment
  27.     # this is a bogus comment
  28.     # this is a bogus comment
  29.     # this is a bogus comment
  30.     # this is a bogus comment
  31.     }
  32.     set msg {}
  33.     list [catch tstProc msg] $msg
  34. } {1 {can't read "zz": no such variable}}
  35. test misc-1.2 {error in variable ref. in command in array reference} {
  36.     proc tstProc {} "
  37.     global a
  38.     
  39.     set tst \$a(\[winfo name \$\{zz)
  40.     # this is a bogus comment
  41.     # this is a bogus comment
  42.     # this is a bogus comment
  43.     # this is a bogus comment
  44.     # this is a bogus comment
  45.     # this is a bogus comment
  46.     # this is a bogus comment
  47.     # this is a bogus comment
  48.     "
  49.     set msg {}
  50.     list [catch tstProc msg] $msg $errorInfo
  51. } {1 {missing close-bracket or close-brace} missing\ close-bracket\ or\ close-brace\n\ \ \ \ while\ compiling\n\"set\ tst\ \$a(\[winfo\ name\ \$\{zz)\"\n\ \ \ \ (compiling\ body\ of\ proc\ \"tstProc\",\ line\ 4)\n\ \ \ \ invoked\ from\ within\n\"tstProc\"}
  52.