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 / arrayproc.test < prev    next >
Encoding:
Text File  |  1994-01-23  |  1.3 KB  |  43 lines

  1. #
  2. # arrayproc.test
  3. #
  4. # Tests for tcl.tlib array routines.
  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: arrayproc.test,v 3.0 1993/11/19 06:57:05 markd Rel $
  16. #------------------------------------------------------------------------------
  17. #
  18.  
  19. if {[info procs test] == ""} then {source testlib.tcl}
  20.  
  21. eval $SAVED_UNKNOWN
  22.  
  23. set testArray(foo) bar
  24. set testArray(snap) frammistan
  25. set testArray(0) zero
  26. set testArray(william) dafoe
  27.  
  28. Test for_array_keys-1.1 {for_array_keys command} {
  29.     for_array_keys key testArray {lappend result $key}
  30.     lsort $result
  31. } 0 "0 foo snap william"
  32.  
  33. unset result
  34.  
  35. Test for_array_keys-1.2 {errors in for_array_keys command} {
  36.     for_array_keys key _non_existent_ {lappend result $key}
  37. } 1 {"_non_existent_" isn't an array}
  38.  
  39. unset testArray
  40. rename unknown {}
  41.  
  42.  
  43.