home *** CD-ROM | disk | FTP | other *** search
- #
- # lassign.test
- #
- # Tests for lassign command.
- #---------------------------------------------------------------------------
- # Copyright 1992-1993 Karl Lehenbauer and Mark Diekhans.
- #
- # Permission to use, copy, modify, and distribute this software and its
- # documentation for any purpose and without fee is hereby granted, provided
- # that the above copyright notice appear in all copies. Karl Lehenbauer and
- # Mark Diekhans make no representations about the suitability of this
- # software for any purpose. It is provided "as is" without express or
- # implied warranty.
- #------------------------------------------------------------------------------
- # $Id: lassign.test,v 3.0 1993/11/19 06:57:10 markd Rel $
- #------------------------------------------------------------------------------
- #
-
- if {[info procs test] == ""} then {source testlib.tcl}
-
- Test lassign-1.1 {lassign command} {
- lassign "a b {c d} e" alpha beta gamma delta epsilon
- list $alpha $beta $gamma $delta $epsilon
- } 0 "a b {c d} e {}"
-
- Test lassign-1.2 {lassign command} {
- set remain [lassign "a b {c d} e gg hhh ii" alpha beta gamma delta]
- list $alpha $beta $gamma $delta $remain
- } 0 "a b {c d} e {gg hhh ii}"
-
- Test lassign-1.3 {lassign command} {
- lassign "a b {c d} e"
- } 1 {wrong # args: lassign list varname ?varname..?}
-
- catch {unset alpha beta gamma delta epsilon}
-
-
-
-