1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
#
# sync.test
#
# Tests for the sync command.
#---------------------------------------------------------------------------
# Copyright 1993-1999 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:
#------------------------------------------------------------------------------
#
if {[cequal [info procs Test] {}]} {
source [file join [file dirname [info script]] testlib.tcl]
}
TestRemove SYNC.TMP
Test sync-1.1 {sync tests} {
sync
} 0 {}
Test sync-1.2 {sync tests} {
sync a b
} 1 {wrong # args: sync ?filehandle?}
Test sync-1.3 {sync tests} {
set fh [open SYNC.TMP w]
puts $fh [replicate XXX 1000]
sync $fh
close $fh
} 0 {}
TestRemove SYNC.TMP
# cleanup
::tcltest::cleanupTests
return
|