home *** CD-ROM | disk | FTP | other *** search
- #
- # stringfil.test
- #
- # Tests for tcl.tlib string file I/O functions.
- #---------------------------------------------------------------------------
- # 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: stringfil.test,v 3.0 1993/11/19 06:58:12 markd Rel $
- #------------------------------------------------------------------------------
- #
-
- if {[info procs test] == ""} then {source testlib.tcl}
- eval $SAVED_UNKNOWN
-
- set stringfileTestVar {a
- b
- c
- d
- e
- f
- g}
-
- unlink -nocomplain STRINGFIL.TEST
-
- Test stringfile-1.1 {write_file command} {
- write_file STRINGFIL.TEST $stringfileTestVar
- } 0 {}
-
- Test stringfile-2.1 {read_file command} {
- read_file STRINGFIL.TEST
- } 0 "$stringfileTestVar\n"
-
- Test stringfile-2.2 {read_file command} {
- read_file -nonewline STRINGFIL.TEST
- } 0 $stringfileTestVar
-
- Test stringfile-2.3 {read_file command} {
- read_file STRINGFIL.TEST 3
- } 0 [crange $stringfileTestVar 0 2]
-
- Test stringfile-2.4 {read_file command} {
- read_file STRINGFIL.TEST nonewline
- } 0 $stringfileTestVar
-
- unlink STRINGFIL.TEST
- rename unknown {}
-
-