From 0fe5391d10c30890ca1740d54448a97edec4f175 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 31 Oct 2004 19:12:34 +0000 Subject: General cleanup --- tests/fCmd.test | 160 ++++++++------------------------------------------------ 1 file changed, 21 insertions(+), 139 deletions(-) diff --git a/tests/fCmd.test b/tests/fCmd.test index 8722826..6ff3872 100644 --- a/tests/fCmd.test +++ b/tests/fCmd.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: fCmd.test,v 1.42 2004/08/31 09:20:10 vincentdarley Exp $ +# RCS: @(#) $Id: fCmd.test,v 1.43 2004/10/31 19:12:34 dkf Exp $ # if {[lsearch [namespace children] ::tcltest] == -1} { @@ -1027,7 +1027,6 @@ test fCmd-11.1 {TclFileRenameCmd: -- option } {notRoot} { file delete tfa2 set result } {1} - test fCmd-11.2 {TclFileRenameCmd: bad option } {notRoot} { catch {file delete -force -- tfa1} set s [createfile tfa1] @@ -1036,11 +1035,9 @@ test fCmd-11.2 {TclFileRenameCmd: bad option } {notRoot} { file delete tfa1 set result } {1} - test fCmd-11.3 {TclFileRenameCmd: bad \# args} { catch {file rename -- } } {1} - test fCmd-11.4 {TclFileRenameCmd: target filename translation failing} {notRoot} { global env set temp $env(HOME) @@ -1049,7 +1046,6 @@ test fCmd-11.4 {TclFileRenameCmd: target filename translation failing} {notRoot} set env(HOME) $temp set result } {1} - test fCmd-11.5 {TclFileRenameCmd: > 1 source & target is not a dir} {notRoot} { catch {file delete -force -- tfa1 tfa2 tfa3} createfile tfa1 @@ -1059,7 +1055,6 @@ test fCmd-11.5 {TclFileRenameCmd: > 1 source & target is not a dir} {notRoot} { file delete tfa1 tfa2 tfa3 set result } {1} - test fCmd-11.6 {TclFileRenameCmd: : single file into directory} {notRoot} { catch {file delete -force -- tfa1 tfad} set s [createfile tfa1] @@ -1069,7 +1064,6 @@ test fCmd-11.6 {TclFileRenameCmd: : single file into directory} {notRoot} { file delete -force tfad set result } {1} - test fCmd-11.7 {TclFileRenameCmd: : multiple files into directory} {notRoot} { catch {file delete -force -- tfa1 tfa2 tfad} set s1 [createfile tfa1 ] @@ -1080,11 +1074,10 @@ test fCmd-11.7 {TclFileRenameCmd: : multiple files into directory} {notRoot} { set r2 [checkcontent tfad/tfa2 $s2] set result [expr $r1 && $r2 && ![file exists tfa1] && ![file exists tfa2]] - + file delete -force tfad set result } {1} - test fCmd-11.8 {TclFileRenameCmd: error renaming file to directory} {notRoot} { catch {file delete -force -- tfa tfad} set s [createfile tfa ] @@ -1109,7 +1102,6 @@ test fCmd-12.1 {renamefile: source filename translation failing} {notRoot} { set env(HOME) $temp set result } {1} - test fCmd-12.2 {renamefile: src filename translation failing} {notRoot} { global env set temp $env(HOME) @@ -1121,13 +1113,11 @@ test fCmd-12.2 {renamefile: src filename translation failing} {notRoot} { file delete -force tfad set result } {1} - test fCmd-12.3 {renamefile: stat failing on source} {notRoot} { catch {file delete -force -- tfa1 tfa2} set r1 [catch {file rename tfa1 tfa2}] expr {$r1 && ![file exists tfa1] && ![file exists tfa2]} } {1} - test fCmd-12.4 {renamefile: error renaming file to directory} {notRoot} { catch {file delete -force -- tfa tfad} set s1 [createfile tfa ] @@ -1140,7 +1130,6 @@ test fCmd-12.4 {renamefile: error renaming file to directory} {notRoot} { file delete -force tfa tfad set result } {1} - test fCmd-12.5 {renamefile: error renaming directory to file} {notRoot} { catch {file delete -force -- tfa tfad} file mkdir tfa @@ -1154,7 +1143,6 @@ test fCmd-12.5 {renamefile: error renaming directory to file} {notRoot} { file delete -force tfa tfad set result } {1} - test fCmd-12.6 {renamefile: TclRenameFile succeeding} {notRoot} { catch {file delete -force -- tfa1 tfa2} set s [createfile tfa1] @@ -1163,7 +1151,6 @@ test fCmd-12.6 {renamefile: TclRenameFile succeeding} {notRoot} { file delete tfa2 set result } {1} - test fCmd-12.7 {renamefile: renaming directory into offspring} {notRoot} { catch {file delete -force -- tfad} file mkdir tfad @@ -1172,7 +1159,6 @@ test fCmd-12.7 {renamefile: renaming directory into offspring} {notRoot} { file delete -force tfad set result } {1} - test fCmd-12.8 {renamefile: generic error} {unix notRoot} { catch {file delete -force -- tfa} file mkdir tfa @@ -1183,8 +1169,6 @@ test fCmd-12.8 {renamefile: generic error} {unix notRoot} { file delete -force tfa set result } {1} - - test fCmd-12.9 {renamefile: moving a file across volumes} {unix notRoot} { catch {file delete -force -- tfa /tmp/tfa} set s [createfile tfa ] @@ -1193,7 +1177,6 @@ test fCmd-12.9 {renamefile: moving a file across volumes} {unix notRoot} { file delete /tmp/tfa set result } {1} - test fCmd-12.10 {renamefile: moving a directory across volumes } \ {unix notRoot} { catch {file delete -force -- tfad /tmp/tfad} @@ -1216,7 +1199,6 @@ test fCmd-13.1 {TclCopyFilesCmd: -force option} {notRoot} { file delete tfa1 tfa2 set result } {1} - test fCmd-13.2 {TclCopyFilesCmd: -- option} {notRoot} { catch {file delete -force -- tfa1} set s [createfile -tfa1] @@ -1225,7 +1207,6 @@ test fCmd-13.2 {TclCopyFilesCmd: -- option} {notRoot} { file delete -- -tfa1 tfa2 set result } {1} - test fCmd-13.3 {TclCopyFilesCmd: bad option} {notRoot} { catch {file delete -force -- tfa1} set s [createfile tfa1] @@ -1234,11 +1215,9 @@ test fCmd-13.3 {TclCopyFilesCmd: bad option} {notRoot} { file delete tfa1 set result } {1} - test fCmd-13.4 {TclCopyFilesCmd: bad \# args} {notRoot} { catch {file copy -- } } {1} - test fCmd-13.5 {TclCopyFilesCmd: target filename translation failing} { global env set temp $env(HOME) @@ -1247,7 +1226,6 @@ test fCmd-13.5 {TclCopyFilesCmd: target filename translation failing} { set env(HOME) $temp set result } {1} - test fCmd-13.6 {TclCopyFilesCmd: > 1 source & target is not a dir} {notRoot} { catch {file delete -force -- tfa1 tfa2 tfa3} createfile tfa1 @@ -1257,7 +1235,6 @@ test fCmd-13.6 {TclCopyFilesCmd: > 1 source & target is not a dir} {notRoot} { file delete tfa1 tfa2 tfa3 set result } {1} - test fCmd-13.7 {TclCopyFilesCmd: single file into directory} {notRoot} { catch {file delete -force -- tfa1 tfad} set s [createfile tfa1] @@ -1267,7 +1244,6 @@ test fCmd-13.7 {TclCopyFilesCmd: single file into directory} {notRoot} { file delete -force tfad tfa1 set result } {1} - test fCmd-13.8 {TclCopyFilesCmd: multiple files into directory} {notRoot} { catch {file delete -force -- tfa1 tfa2 tfad} set s1 [createfile tfa1 ] @@ -1279,11 +1255,10 @@ test fCmd-13.8 {TclCopyFilesCmd: multiple files into directory} {notRoot} { set r3 [checkcontent tfa1 $s1] set r4 [checkcontent tfa2 $s2] set result [expr $r1 && $r2 && $r3 && $r4 ] - + file delete -force tfad tfa1 tfa2 set result } {1} - test fCmd-13.9 {TclCopyFilesCmd: error copying file to directory} {notRoot} { catch {file delete -force -- tfa tfad} set s [createfile tfa ] @@ -1308,7 +1283,6 @@ test fCmd-14.1 {copyfile: source filename translation failing} {notRoot} { set env(HOME) $temp set result } {1} - test fCmd-14.2 {copyfile: dst filename translation failing} {notRoot} { global env set temp $env(HOME) @@ -1321,13 +1295,11 @@ test fCmd-14.2 {copyfile: dst filename translation failing} {notRoot} { file delete -force tfa1 tfad set result } {1} - test fCmd-14.3 {copyfile: stat failing on source} {notRoot} { catch {file delete -force -- tfa1 tfa2} set r1 [catch {file copy tfa1 tfa2}] expr $r1 && ![file exists tfa1] && ![file exists tfa2] } {1} - test fCmd-14.4 {copyfile: error copying file to directory} {notRoot} { catch {file delete -force -- tfa tfad} set s1 [createfile tfa ] @@ -1341,8 +1313,7 @@ test fCmd-14.4 {copyfile: error copying file to directory} {notRoot} { file delete -force tfa tfad set result } {1} - - test fCmd-14.5 {copyfile: error copying directory to file} {notRoot} { +test fCmd-14.5 {copyfile: error copying directory to file} {notRoot} { catch {file delete -force -- tfa tfad} file mkdir tfa file mkdir tfad @@ -1355,7 +1326,6 @@ test fCmd-14.4 {copyfile: error copying file to directory} {notRoot} { file delete -force tfa tfad set result } {1} - test fCmd-14.6 {copyfile: copy file succeeding} {notRoot} { catch {file delete -force -- tfa tfa2} set s [createfile tfa] @@ -1364,7 +1334,6 @@ test fCmd-14.6 {copyfile: copy file succeeding} {notRoot} { file delete tfa tfa2 set result } {1} - test fCmd-14.7 {copyfile: copy directory succeeding} {notRoot} { catch {file delete -force -- tfa tfa2} file mkdir tfa @@ -1374,7 +1343,6 @@ test fCmd-14.7 {copyfile: copy directory succeeding} {notRoot} { file delete -force tfa tfa2 set result } {1} - test fCmd-14.8 {copyfile: copy directory failing} {unix notRoot} { catch {file delete -force -- tfa} file mkdir tfa/dir/a/b/c @@ -1408,7 +1376,6 @@ test fCmd-15.2 {TclMakeDirsCmd - one directory } {notRoot} { file delete tfa set result } {1} - test fCmd-15.3 {TclMakeDirsCmd: - two directories} {notRoot} { catch {file delete -force -- tfa1 tfa2} file mkdir tfa1 tfa2 @@ -1416,7 +1383,6 @@ test fCmd-15.3 {TclMakeDirsCmd: - two directories} {notRoot} { file delete tfa1 tfa2 set result } {1} - test fCmd-15.4 {TclMakeDirsCmd - stat failing} {unix notRoot} { catch {file delete -force -- tfa} file mkdir tfa @@ -1427,7 +1393,6 @@ test fCmd-15.4 {TclMakeDirsCmd - stat failing} {unix notRoot} { file delete -force tfa set result } {1} - test fCmd-15.5 {TclMakeDirsCmd: - making a directory several levels deep} \ {notRoot} { catch {file delete -force -- tfa} @@ -1436,8 +1401,6 @@ test fCmd-15.5 {TclMakeDirsCmd: - making a directory several levels deep} \ file delete -force tfa set result } {1} - - test fCmd-15.6 {TclMakeDirsCmd: - trying to overwrite a file} {notRoot} { catch {file delete -force -- tfa} set s [createfile tfa] @@ -1448,7 +1411,6 @@ test fCmd-15.6 {TclMakeDirsCmd: - trying to overwrite a file} {notRoot} { file delete tfa set result } {1} - test fCmd-15.7 {TclMakeDirsCmd - making several directories} {notRoot} { catch {file delete -force -- tfa1 tfa2} file mkdir tfa1 tfa2/a/b/c @@ -1456,7 +1418,6 @@ test fCmd-15.7 {TclMakeDirsCmd - making several directories} {notRoot} { file delete -force tfa1 tfa2 set result } {1} - test fCmd-15.8 {TclFileMakeDirsCmd: trying to create an existing dir} {notRoot} { file mkdir tfa file mkdir tfa @@ -1465,7 +1426,6 @@ test fCmd-15.8 {TclFileMakeDirsCmd: trying to create an existing dir} {notRoot} set result } {1} - # Coverage tests for TclDeleteFilesCommand() test fCmd-16.1 {test the -- argument} {notRoot} { catch {file delete -force -- tfa} @@ -1473,14 +1433,12 @@ test fCmd-16.1 {test the -- argument} {notRoot} { file delete -- tfa file exists tfa } {0} - test fCmd-16.2 {test the -force and -- arguments} {notRoot} { catch {file delete -force -- tfa} createfile tfa file delete -force -- tfa file exists tfa } {0} - test fCmd-16.3 {test bad option} {notRoot} { catch {file delete -force -- tfa} createfile tfa @@ -1488,15 +1446,12 @@ test fCmd-16.3 {test bad option} {notRoot} { file delete tfa set result } {1} - test fCmd-16.4 {test not enough args} {notRoot} { catch {file delete} } {1} - test fCmd-16.5 {test not enough args with options} {notRoot} { catch {file delete --} } {1} - test fCmd-16.6 {delete: source filename translation failing} {notRoot} { global env set temp $env(HOME) @@ -1505,7 +1460,6 @@ test fCmd-16.6 {delete: source filename translation failing} {notRoot} { set env(HOME) $temp set result } {1} - test fCmd-16.7 {remove a non-empty directory without -force } {notRoot} { catch {file delete -force -- tfa} file mkdir tfa @@ -1514,7 +1468,6 @@ test fCmd-16.7 {remove a non-empty directory without -force } {notRoot} { file delete -force tfa set result } {1} - test fCmd-16.8 {remove a normal file } {notRoot} { catch {file delete -force -- tfa} file mkdir tfa @@ -1523,7 +1476,6 @@ test fCmd-16.8 {remove a normal file } {notRoot} { file delete -force tfa set result } {1} - test fCmd-16.9 {error while deleting file } {unix notRoot} { catch {file delete -force -- tfa} file mkdir tfa @@ -1539,7 +1491,6 @@ test fCmd-16.9 {error while deleting file } {unix notRoot} { file delete -force tfa set result } {1} - test fCmd-16.10 {deleting multiple files} {notRoot} { catch {file delete -force -- tfa1 tfa2} createfile tfa1 @@ -1547,7 +1498,6 @@ test fCmd-16.10 {deleting multiple files} {notRoot} { file delete tfa1 tfa2 expr ![file exists tfa1] && ![file exists tfa2] } {1} - test fCmd-16.11 {TclFileDeleteCmd: removing a nonexistant file} {notRoot} { catch {file delete -force -- tfa} file delete tfa @@ -1555,7 +1505,7 @@ test fCmd-16.11 {TclFileDeleteCmd: removing a nonexistant file} {notRoot} { } {1} # More coverage tests for mkpath() - test fCmd-17.1 {mkdir stat failing on target but not ENOENT} {unix notRoot} { +test fCmd-17.1 {mkdir stat failing on target but not ENOENT} {unix notRoot} { catch {file delete -force -- tfa1} file mkdir tfa1 file attributes tfa1 -permissions 0555 @@ -1564,7 +1514,6 @@ test fCmd-16.11 {TclFileDeleteCmd: removing a nonexistant file} {notRoot} { file delete -force tfa1 set result } {1} - test fCmd-17.2 {mkdir several levels deep - relative } {notRoot} { catch {file delete -force -- tfa} file mkdir tfa/a/b @@ -1572,7 +1521,6 @@ test fCmd-17.2 {mkdir several levels deep - relative } {notRoot} { file delete tfa/a/b tfa/a tfa set result } {1} - test fCmd-17.3 {mkdir several levels deep - absolute } {notRoot} { catch {file delete -force -- tfa} set f [file join [pwd] tfa a ] @@ -1606,7 +1554,6 @@ test fCmd-18.1 {TclFileRenameCmd: rename (first form) in the same directory} \ file delete -force tfad set result } {1} - test fCmd-18.2 {TclFileRenameCmd: single dir to nonexistant} {notRoot} { catch {file delete -force -- tfa1 tfa2} file mkdir tfa1 @@ -1615,7 +1562,6 @@ test fCmd-18.2 {TclFileRenameCmd: single dir to nonexistant} {notRoot} { file delete tfa2 set result } {1} - test fCmd-18.3 {TclFileRenameCmd: mixed dirs and files into directory} {notRoot} { catch {file delete -force -- tfa1 tfad1 tfad2} set s [createfile tfa1 ] @@ -1628,7 +1574,6 @@ test fCmd-18.3 {TclFileRenameCmd: mixed dirs and files into directory} {notRoot} file delete -force tfad2 set result } {1} - test fCmd-18.4 {TclFileRenameCmd: attempt to replace non-dir with dir} {notRoot} { catch {file delete -force -- tfa tfad} set s [createfile tfa ] @@ -1640,7 +1585,6 @@ test fCmd-18.4 {TclFileRenameCmd: attempt to replace non-dir with dir} {notRoot} file delete tfa tfad set result } {1} - test fCmd-18.5 {TclFileRenameCmd: attempt to replace dir with non-dir} {notRoot} { catch {file delete -force -- tfa tfad} set s [createfile tfa ] @@ -1652,7 +1596,6 @@ test fCmd-18.5 {TclFileRenameCmd: attempt to replace dir with non-dir} {notRoot} file delete -force tfa tfad set result } {1} - # # On Windows there is no easy way to determine if two files are the same # @@ -1664,7 +1607,6 @@ test fCmd-18.6 {TclFileRenameCmd: rename a file to itself} {unix notRoot} { file delete tfa set result } {1} - test fCmd-18.7 {TclFileRenameCmd: rename dir on top of another empty dir w/o -force} \ {notRoot} { catch {file delete -force -- tfa tfad} @@ -1674,7 +1616,6 @@ test fCmd-18.7 {TclFileRenameCmd: rename dir on top of another empty dir w/o -fo file delete -force tfa tfad set result } {1} - test fCmd-18.8 {TclFileRenameCmd: rename dir on top of another empty dir w/ -force} -setup { catch {file delete -force -- tfa tfad} } -constraints {notRoot notNetworkFilesystem} -body { @@ -1684,7 +1625,6 @@ test fCmd-18.8 {TclFileRenameCmd: rename dir on top of another empty dir w/ -for } -cleanup { file delete -force tfad } -result 0 - test fCmd-18.9 {TclFileRenameCmd: rename dir on top of a non-empty dir w/o -force} \ {notRoot} { catch {file delete -force -- tfa tfad} @@ -1694,7 +1634,6 @@ test fCmd-18.9 {TclFileRenameCmd: rename dir on top of a non-empty dir w/o -forc file delete -force tfa tfad set result } {1} - test fCmd-18.10 {TclFileRenameCmd: rename dir on top of a non-empty dir w/ -force} \ {notRoot} { catch {file delete -force -- tfa tfad} @@ -1704,17 +1643,15 @@ test fCmd-18.10 {TclFileRenameCmd: rename dir on top of a non-empty dir w/ -forc file delete -force tfa tfad set result } {1} - test fCmd-18.11 {TclFileRenameCmd: rename a non-existant file} {notRoot} { catch {file delete -force -- tfa1} set r1 [catch {file rename tfa1 tfa2}] set result [expr $r1 && ![file exists tfa1] && ![file exists tfa2]] } {1} - test fCmd-18.12 {TclFileRenameCmd : rename a symbolic link to file} \ {unix notRoot} { catch {file delete -force -- tfa1 tfa2 tfa3} - + set s [createfile tfa1] file link -symbolic tfa2 tfa1 file rename tfa2 tfa3 @@ -1723,11 +1660,10 @@ test fCmd-18.12 {TclFileRenameCmd : rename a symbolic link to file} \ file delete tfa1 tfa3 set result } {1} - test fCmd-18.13 {TclFileRenameCmd : rename a symbolic link to dir} \ {unix notRoot} { catch {file delete -force -- tfa1 tfa2 tfa3} - + file mkdir tfa1 file link -symbolic tfa2 tfa1 file rename tfa2 tfa3 @@ -1736,11 +1672,10 @@ test fCmd-18.13 {TclFileRenameCmd : rename a symbolic link to dir} \ file delete tfa1 tfa3 set result } {1} - test fCmd-18.14 {TclFileRenameCmd : rename a path with sym link} \ {unix notRoot} { catch {file delete -force -- tfa1 tfa2 tfa3} - + file mkdir tfa1/a/b/c/d file mkdir tfa2 set f [file join [pwd] tfa1/a/b] @@ -1753,11 +1688,10 @@ test fCmd-18.14 {TclFileRenameCmd : rename a path with sym link} \ file delete -force tfa1 tfa2 tfa3 set result } {1} - test fCmd-18.15 {TclFileRenameCmd : rename a file to a symlink dir} \ {unix notRoot} { catch {file delete -force -- tfa1 tfa2 tfalink} - + file mkdir tfa1 set s [createfile tfa2] file link -symbolic tfalink tfa1 @@ -1767,10 +1701,9 @@ test fCmd-18.15 {TclFileRenameCmd : rename a file to a symlink dir} \ file delete -force tfa1 tfalink set result } {1} - test fCmd-18.16 {TclFileRenameCmd: rename a dangling symlink} {unix notRoot} { catch {file delete -force -- tfa1 tfalink} - + file mkdir tfa1 file link -symbolic tfalink tfa1 file delete tfa1 @@ -1780,7 +1713,6 @@ test fCmd-18.16 {TclFileRenameCmd: rename a dangling symlink} {unix notRoot} { set result } {1} - # # Coverage tests for TclUnixRmdir # @@ -1790,7 +1722,6 @@ test fCmd-19.1 {remove empty directory} {notRoot} { file delete tfa file exists tfa } {0} - test fCmd-19.2 {rmdir error besides EEXIST} {unix notRoot} { catch {file delete -force -- tfa} file mkdir tfa @@ -1801,7 +1732,6 @@ test fCmd-19.2 {rmdir error besides EEXIST} {unix notRoot} { file delete -force tfa set result } {1} - test fCmd-19.3 {recursive remove} {notRoot} { catch {file delete -force -- tfa} file mkdir tfa @@ -1832,7 +1762,6 @@ test fCmd-20.1 {TraverseUnixTree : failure opening a subdirectory directory } \ set result } {1} - # # Feature testing for TclCopyFilesCmd # @@ -1844,7 +1773,6 @@ test fCmd-21.1 {copy : single file to nonexistant } {notRoot} { file delete tfa1 tfa2 set result } {1} - test fCmd-21.2 {copy : single dir to nonexistant } {notRoot} { catch {file delete -force -- tfa1 tfa2} file mkdir tfa1 @@ -1853,7 +1781,6 @@ test fCmd-21.2 {copy : single dir to nonexistant } {notRoot} { file delete tfa1 tfa2 set result } {1} - test fCmd-21.3 {copy : single file into directory } {notRoot} { catch {file delete -force -- tfa1 tfad} set s [createfile tfa1] @@ -1863,7 +1790,6 @@ test fCmd-21.3 {copy : single file into directory } {notRoot} { file delete -force tfa1 tfad set result } {1} - test fCmd-21.4 {copy : more than one source and target is not a directory} \ {notRoot} { catch {file delete -force -- tfa1 tfa2 tfa3} @@ -1874,7 +1800,6 @@ test fCmd-21.4 {copy : more than one source and target is not a directory} \ file delete tfa1 tfa2 tfa3 set result } {1} - test fCmd-21.5 {copy : multiple files into directory } {notRoot} { catch {file delete -force -- tfa1 tfa2 tfad} set s1 [createfile tfa1 ] @@ -1889,7 +1814,6 @@ test fCmd-21.5 {copy : multiple files into directory } {notRoot} { file delete -force tfa1 tfa2 tfad set result } {1} - test fCmd-21.6 {copy: mixed dirs and files into directory} \ {notRoot notFileSharing} { catch {file delete -force -- tfa1 tfad1 tfad2} @@ -1903,7 +1827,6 @@ test fCmd-21.6 {copy: mixed dirs and files into directory} \ file delete -force tfa1 tfad1 tfad2 set result } {1} - test fCmd-21.7.1 {TclCopyFilesCmd: copy a dangling link} {unix notRoot dontCopyLinks} { file mkdir tfad1 file link -symbolic tfalink tfad1 @@ -1921,7 +1844,6 @@ test fCmd-21.7.2 {TclCopyFilesCmd: copy a dangling link} {unix notRoot} { file delete tfalink tfalink2 set result } {1} - test fCmd-21.8.1 {TclCopyFilesCmd: copy a link } {unix notRoot dontCopyLinks} { file mkdir tfad1 file link -symbolic tfalink tfad1 @@ -1944,7 +1866,6 @@ test fCmd-21.8.2 {TclCopyFilesCmd: copy a link } {unix notRoot} { file delete -force tfad1 tfalink tfalink2 set result } {1} - test fCmd-21.9 {TclCopyFilesCmd: copy dir with a link in it} {unix notRoot} { file mkdir tfad1 file link -symbolic tfad1/tfalink "[pwd]/tfad1" @@ -1953,7 +1874,6 @@ test fCmd-21.9 {TclCopyFilesCmd: copy dir with a link in it} {unix notRoot} { file delete -force tfad1 tfad2 set result } {1} - test fCmd-21.10 {TclFileCopyCmd: copy dir on top of another empty dir w/o -force} \ {notRoot} { catch {file delete -force -- tfa tfad} @@ -1963,7 +1883,6 @@ test fCmd-21.10 {TclFileCopyCmd: copy dir on top of another empty dir w/o -force file delete -force tfa tfad set result } {1} - test fCmd-21.11 {TclFileCopyCmd: copy dir on top of a dir w/o -force} {notRoot} { catch {file delete -force -- tfa tfad} file mkdir tfa [file join tfad tfa file] @@ -1972,7 +1891,6 @@ test fCmd-21.11 {TclFileCopyCmd: copy dir on top of a dir w/o -force} {notRoot} file delete -force tfa tfad set result } {1} - test fCmd-21.12 {TclFileCopyCmd: copy dir on top of a non-empty dir w/ -force} \ {notRoot} { catch {file delete -force -- tfa tfad} @@ -1990,14 +1908,13 @@ test fCmd-22.1 {TclpRenameFile: rename and overwrite in a single dir} {notRoot} catch {file delete -force -- tfa1 tfa2} set s [createfile tfa1] set s2 [createfile tfa2 q] - + set r1 [catch {rename tfa1 tfa2}] file rename -force tfa1 tfa2 set result [expr $r1 && [checkcontent tfa2 $s]] file delete [glob tfa1 tfa2] set result } {1} - test fCmd-22.2 {TclpRenameFile: attempt to overwrite itself} {unix notRoot} { catch {file delete -force -- tfa1} set s [createfile tfa1] @@ -2006,7 +1923,6 @@ test fCmd-22.2 {TclpRenameFile: attempt to overwrite itself} {unix notRoot} { file delete tfa1 set result } {1} - test fCmd-22.3 {TclpRenameFile: rename dir to existing dir} {notRoot} { catch {file delete -force -- d1 tfad} file mkdir d1 [file join tfad d1] @@ -2015,7 +1931,6 @@ test fCmd-22.3 {TclpRenameFile: rename dir to existing dir} {notRoot} { file delete -force d1 tfad set result } {1} - test fCmd-22.4 {TclpRenameFile: rename dir to dir several levels deep} {notRoot} { catch {file delete -force -- d1 tfad} file mkdir d1 [file join tfad a b c] @@ -2024,8 +1939,6 @@ test fCmd-22.4 {TclpRenameFile: rename dir to dir several levels deep} {notRoot} file delete -force [glob d1 tfad] set result } {1} - - # # TclMacCopyFile needs to be redone. # @@ -2053,9 +1966,9 @@ test fCmd-22.5 {TclMacCopyFile: copy and overwrite in a single dir} {notRoot} { test fCmd-23.1 {TclMacRmdir: trying to remove a nonempty directory} {notRoot} { catch {file delete -force -- tfad} - + file mkdir [file join tfad dir] - + set result [catch {file delete tfad}] file delete -force tfad set result @@ -2067,7 +1980,7 @@ test fCmd-23.1 {TclMacRmdir: trying to remove a nonempty directory} {notRoot} { # test fCmd-24.1 {TclMacDeleteFile: deleting a normal file} {notRoot} { catch {file delete -force -- tfa1} - + createfile tfa1 file delete tfa1 file exists tfa1 @@ -2079,27 +1992,25 @@ test fCmd-24.1 {TclMacDeleteFile: deleting a normal file} {notRoot} { # test fCmd-25.1 {TclMacCopyDirectory: copying a normal directory} {notRoot notFileSharing} { catch {file delete -force -- tfad1 tfad2} - + file mkdir [file join tfad1 a b c] file copy tfad1 tfad2 set result [expr [file isdir [file join tfad1 a b c]] && [file isdir [file join tfad2 a b c]]] file delete -force tfad1 tfad2 set result } {1} - test fCmd-25.2 {TclMacCopyDirectory: copying a short path normal directory} {notRoot notFileSharing} { catch {file delete -force -- tfad1 tfad2} - + file mkdir tfad1 file copy tfad1 tfad2 set result [expr [file isdir tfad1] && [file isdir tfad2]] file delete tfad1 tfad2 set result } {1} - test fCmd-25.3 {TclMacCopyDirectory: copying dirs between different dirs} {notRoot notFileSharing} { catch {file delete -force -- tfad1 tfad2} - + file mkdir [file join tfad1 x y z] file mkdir [file join tfad2 dir] file copy tfad1 [file join tfad2 dir] @@ -2114,22 +2025,21 @@ test fCmd-25.3 {TclMacCopyDirectory: copying dirs between different dirs} {notRo test fCmd-26.1 {TclDeleteFilesCmd: delete symlink} {unix notRoot} { catch {file delete -force -- tfad1 tfad2} - + file mkdir tfad1 file link -symbolic tfalink tfad1 file delete tfalink set r1 [file isdir tfad1] set r2 [file exists tfalink] - + set result [expr $r1 && !$r2] file delete tfad1 set result } {1} - test fCmd-26.2 {TclDeleteFilesCmd: delete dir with symlink} {unix notRoot} { catch {file delete -force -- tfad1 tfad2} - + file mkdir tfad1 file mkdir tfad2 file link -symbolic [file join tfad2 link] [file join .. tfad1] @@ -2142,10 +2052,9 @@ test fCmd-26.2 {TclDeleteFilesCmd: delete dir with symlink} {unix notRoot} { file delete tfad1 set result } {1} - test fCmd-26.3 {TclDeleteFilesCmd: delete dangling symlink} {unix notRoot} { catch {file delete -force -- tfad1 tfad2} - + file mkdir tfad1 file link -symbolic tfad2 tfad1 file delete tfad1 @@ -2174,7 +2083,6 @@ test fCmd-27.4 {TclFileAttrsCmd - getting one option} { set attrs [file attributes foo.tmp] list [catch {file attributes foo.tmp {expand}[lindex $attrs 0]}] [file delete -force -- foo.tmp] } {0 {}} - # Find a group that exists on this Unix system, or else skip tests that # require Unix groups. if {$tcl_platform(platform) == "unix"} { @@ -2187,7 +2095,6 @@ if {$tcl_platform(platform) == "unix"} { } else { ::tcltest::testConstraint foundGroup 1 } - test fCmd-27.5 {TclFileAttrsCmd - setting one option} {foundGroup} { catch {file delete -force -- foo.tmp} createfile foo.tmp @@ -2218,25 +2125,20 @@ if {[string equal $tcl_platform(platform) "windows"]} { test fCmd-28.1 {file link} { list [catch {file link} msg] $msg } {1 {wrong # args: should be "file link ?-linktype? linkname ?target?"}} - test fCmd-28.2 {file link} { list [catch {file link a b c d} msg] $msg } {1 {wrong # args: should be "file link ?-linktype? linkname ?target?"}} - test fCmd-28.3 {file link} { list [catch {file link abc b c} msg] $msg } {1 {bad switch "abc": must be -symbolic or -hard}} - test fCmd-28.4 {file link} { list [catch {file link -abc b c} msg] $msg } {1 {bad switch "-abc": must be -symbolic or -hard}} cd [workingDirectory] - makeDirectory abc.dir makeDirectory abc2.dir makeFile contents abc.file makeFile contents abc2.file - cd [temporaryDirectory] test fCmd-28.5 {file link: source already exists} {linkDirectory} { cd [temporaryDirectory] @@ -2244,28 +2146,24 @@ test fCmd-28.5 {file link: source already exists} {linkDirectory} { cd [workingDirectory] set res } {1 {could not create new link "abc.dir": that path already exists}} - test fCmd-28.6 {file link: unsupported operation} {linkDirectory win} { cd [temporaryDirectory] set res [list [catch {file link -hard abc.link abc.dir} msg] $msg] cd [workingDirectory] set res } {1 {could not create new link "abc.link" pointing to "abc.dir": illegal operation on a directory}} - test fCmd-28.7 {file link: source already exists} {linkFile} { cd [temporaryDirectory] set res [list [catch {file link abc.file abc2.file} msg] $msg] cd [workingDirectory] set res } {1 {could not create new link "abc.file": that path already exists}} - test fCmd-28.8 {file link} {linkFile win} { cd [temporaryDirectory] set res [list [catch {file link -symbolic abc.link abc.file} msg] $msg] cd [workingDirectory] set res } {1 {could not create new link "abc.link" pointing to "abc.file": not a directory}} - test fCmd-28.9 {file link: success with file} {linkFile} { cd [temporaryDirectory] file delete -force abc.link @@ -2273,11 +2171,9 @@ test fCmd-28.9 {file link: success with file} {linkFile} { cd [workingDirectory] set res } {0 abc.file} - cd [temporaryDirectory] catch {file delete -force abc.link} cd [workingDirectory] - test fCmd-28.10 {file link: linking to nonexistent path} {linkDirectory} { cd [temporaryDirectory] file delete -force abc.link @@ -2285,7 +2181,6 @@ test fCmd-28.10 {file link: linking to nonexistent path} {linkDirectory} { cd [workingDirectory] set res } {1 {could not create new link "abc.link": target "abc2.doesnt" doesn't exist}} - test fCmd-28.10.1 {file link: linking to nonexistent path} {linkDirectory} { cd [temporaryDirectory] file delete -force abc.link @@ -2293,7 +2188,6 @@ test fCmd-28.10.1 {file link: linking to nonexistent path} {linkDirectory} { cd [workingDirectory] set res } {1 {could not create new link "doesnt/abc.link": no such file or directory}} - test fCmd-28.11 {file link: success with directory} {linkDirectory} { cd [temporaryDirectory] file delete -force abc.link @@ -2301,7 +2195,6 @@ test fCmd-28.11 {file link: success with directory} {linkDirectory} { cd [workingDirectory] set res } {0 abc.dir} - test fCmd-28.12 {file link: cd into a link} {linkDirectory} { cd [temporaryDirectory] file delete -force abc.link @@ -2327,7 +2220,6 @@ test fCmd-28.12 {file link: cd into a link} {linkDirectory} { cd [workingDirectory] set res } {ok} - test fCmd-28.13 {file link} {linkDirectory} { # duplicate link throws error cd [temporaryDirectory] @@ -2335,7 +2227,6 @@ test fCmd-28.13 {file link} {linkDirectory} { cd [workingDirectory] set res } {1 {could not create new link "abc.link": that path already exists}} - test fCmd-28.14 {file link: deletes link not dir} {linkDirectory} { cd [temporaryDirectory] file delete -force abc.link @@ -2343,7 +2234,6 @@ test fCmd-28.14 {file link: deletes link not dir} {linkDirectory} { cd [workingDirectory] set res } {0 1} - test fCmd-28.15.1 {file link: copies link not dir} {linkDirectory dontCopyLinks} { cd [temporaryDirectory] file delete -force abc.link @@ -2364,7 +2254,6 @@ test fCmd-28.15.2 {file link: copies link not dir} {linkDirectory} { cd [workingDirectory] set res } {link abc.dir} - cd [temporaryDirectory] file delete -force abc.link file delete -force abc2.link @@ -2375,7 +2264,6 @@ cd .. file copy abc.file abc.dir file copy abc2.file abc.dir cd [workingDirectory] - test fCmd-28.16 {file link: glob inside link} {linkDirectory} { cd [temporaryDirectory] file delete -force abc.link @@ -2384,40 +2272,34 @@ test fCmd-28.16 {file link: glob inside link} {linkDirectory} { cd [workingDirectory] lsort $res } {abc.file abc2.file} - test fCmd-28.17 {file link: glob -type l} {linkDirectory} { cd [temporaryDirectory] set res [glob -dir [pwd] -type l -tails abc*] cd [workingDirectory] set res } {abc.link} - test fCmd-28.18 {file link: glob -type d} {linkDirectory} { cd [temporaryDirectory] set res [lsort [glob -dir [pwd] -type d -tails abc*]] cd [workingDirectory] set res } [lsort [list abc.link abc.dir abc2.dir]] - test fCmd-28.19 {file link: relative paths} {win linkDirectory} { cd [temporaryDirectory] file mkdir d1/d2/d3 set res [list [catch {file link d1/l2 d1/d2} err] $err] lappend res [catch {file delete -force d1} err] $err } {0 d1/d2 0 {}} - test fCmd-28.20 {file link: relative paths} {unix linkDirectory} { cd [temporaryDirectory] file mkdir d1/d2/d3 list [catch {file link d1/l2 d1/d2} res] $res } {1 {could not create new link "d1/l2": target "d1/d2" doesn't exist}} - test fCmd-28.21 {file link: relative paths} {unix linkDirectory} { cd [temporaryDirectory] file mkdir d1/d2/d3 list [catch {file link d1/l2 d2} res] $res } {0 d2} - test fCmd-28.22 {file link: relative paths} {unix linkDirectory} { cd [temporaryDirectory] file mkdir d1/d2/d3 -- cgit v0.12