home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / devel / tcl / tclx7_31.z / tclx7_31 / tcldev / tclX7.3a-p1 / tests / lassign.test < prev    next >
Encoding:
Text File  |  1994-01-23  |  1.3 KB  |  39 lines

  1. #
  2. # lassign.test
  3. #
  4. # Tests for lassign command.
  5. #---------------------------------------------------------------------------
  6. # Copyright 1992-1993 Karl Lehenbauer and Mark Diekhans.
  7. #
  8. # Permission to use, copy, modify, and distribute this software and its
  9. # documentation for any purpose and without fee is hereby granted, provided
  10. # that the above copyright notice appear in all copies.  Karl Lehenbauer and
  11. # Mark Diekhans make no representations about the suitability of this
  12. # software for any purpose.  It is provided "as is" without express or
  13. # implied warranty.
  14. #------------------------------------------------------------------------------
  15. # $Id: lassign.test,v 3.0 1993/11/19 06:57:10 markd Rel $
  16. #------------------------------------------------------------------------------
  17. #
  18.  
  19. if {[info procs test] == ""} then {source testlib.tcl}
  20.  
  21. Test lassign-1.1 {lassign command} {
  22.     lassign "a b {c d} e" alpha beta gamma delta epsilon
  23.     list $alpha $beta $gamma $delta $epsilon
  24. } 0 "a b {c d} e {}"
  25.  
  26. Test lassign-1.2 {lassign command} {
  27.     set remain [lassign "a b {c d} e gg hhh ii" alpha beta gamma delta]
  28.     list $alpha $beta $gamma $delta $remain
  29. } 0 "a b {c d} e {gg hhh ii}"
  30.  
  31. Test lassign-1.3 {lassign command} {
  32.     lassign "a b {c d} e"
  33. } 1 {wrong # args: lassign list varname ?varname..?}
  34.  
  35. catch {unset alpha beta gamma delta epsilon}
  36.  
  37.  
  38.  
  39.