]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/io/files/unix/unix-tests.factor
factor: rename [ ] [ ] unit-test -> { } [ ] unit-test using a refactoring tool!
[factor.git] / basis / io / files / unix / unix-tests.factor
index a7fa1ed4e92966d4f66560ed13bdf4ef0fa0ccc0..b380c3313a0c4361d62a2b714016e02f5aee088e 100644 (file)
@@ -5,32 +5,32 @@ math.functions math unix.users unix.groups arrays sequences
 grouping io.pathnames.private literals ;
 IN: io.files.unix.tests
 
-[ "/usr/libexec/" ] [ "/usr/libexec/awk/" parent-directory ] unit-test
-[ "/etc/" ] [ "/etc/passwd" parent-directory ] unit-test
-[ "/" ] [ "/etc/" parent-directory ] unit-test
-[ "/" ] [ "/etc" parent-directory ] unit-test
-[ "/" ] [ "/" parent-directory ] unit-test
-
-[ f ] [ "" root-directory? ] unit-test
-[ t ] [ "/" root-directory? ] unit-test
-[ t ] [ "//" root-directory? ] unit-test
-[ t ] [ "///////" root-directory? ] unit-test
-
-[ "/" ] [ "/" file-name ] unit-test
-[ "///" ] [ "///" file-name ] unit-test
-
-[ "/" ] [ "/" "../.." append-path ] unit-test
-[ "/" ] [ "/" "../../" append-path ] unit-test
-[ "/lib" ] [ "/" "../lib" append-path ] unit-test
-[ "/lib/" ] [ "/" "../lib/" append-path ] unit-test
-[ "/lib" ] [ "/" "../../lib" append-path ] unit-test
-[ "/lib/" ] [ "/" "../../lib/" append-path ] unit-test
-
-[ "/lib" ] [ "/usr/" "/lib" append-path ] unit-test
-[ "/lib/" ] [ "/usr/" "/lib/" append-path ] unit-test
-[ "/lib/bux" ] [ "/usr" "/lib/bux" append-path ] unit-test
-[ "/lib/bux/" ] [ "/usr" "/lib/bux/" append-path ] unit-test
-[ t ] [ "/foo" absolute-path? ] unit-test
+{ "/usr/libexec/" } [ "/usr/libexec/awk/" parent-directory ] unit-test
+{ "/etc/" } [ "/etc/passwd" parent-directory ] unit-test
+{ "/" } [ "/etc/" parent-directory ] unit-test
+{ "/" } [ "/etc" parent-directory ] unit-test
+{ "/" } [ "/" parent-directory ] unit-test
+
+{ f } [ "" root-directory? ] unit-test
+{ t } [ "/" root-directory? ] unit-test
+{ t } [ "//" root-directory? ] unit-test
+{ t } [ "///////" root-directory? ] unit-test
+
+{ "/" } [ "/" file-name ] unit-test
+{ "///" } [ "///" file-name ] unit-test
+
+{ "/" } [ "/" "../.." append-path ] unit-test
+{ "/" } [ "/" "../../" append-path ] unit-test
+{ "/lib" } [ "/" "../lib" append-path ] unit-test
+{ "/lib/" } [ "/" "../lib/" append-path ] unit-test
+{ "/lib" } [ "/" "../../lib" append-path ] unit-test
+{ "/lib/" } [ "/" "../../lib/" append-path ] unit-test
+
+{ "/lib" } [ "/usr/" "/lib" append-path ] unit-test
+{ "/lib/" } [ "/usr/" "/lib/" append-path ] unit-test
+{ "/lib/bux" } [ "/usr" "/lib/bux" append-path ] unit-test
+{ "/lib/bux/" } [ "/usr" "/lib/bux/" append-path ] unit-test
+{ t } [ "/foo" absolute-path? ] unit-test
 
 : test-file ( -- path )
     "permissions" temp-file ;
@@ -44,52 +44,52 @@ IN: io.files.unix.tests
 
 prepare-test-file
 
-[ t ]
+{ t }
 [ test-file flags{ USER-ALL GROUP-ALL OTHER-ALL } set-file-permissions perms 0o777 = ] unit-test
 
-[ t ] [ test-file user-read? ] unit-test
-[ t ] [ test-file user-write? ] unit-test
-[ t ] [ test-file user-execute? ] unit-test
-[ t ] [ test-file group-read? ] unit-test
-[ t ] [ test-file group-write? ] unit-test
-[ t ] [ test-file group-execute? ] unit-test
-[ t ] [ test-file other-read? ] unit-test
-[ t ] [ test-file other-write? ] unit-test
-[ t ] [ test-file other-execute? ] unit-test
+{ t } [ test-file user-read? ] unit-test
+{ t } [ test-file user-write? ] unit-test
+{ t } [ test-file user-execute? ] unit-test
+{ t } [ test-file group-read? ] unit-test
+{ t } [ test-file group-write? ] unit-test
+{ t } [ test-file group-execute? ] unit-test
+{ t } [ test-file other-read? ] unit-test
+{ t } [ test-file other-write? ] unit-test
+{ t } [ test-file other-execute? ] unit-test
 
-[ t ] [ test-file f set-other-execute perms 0o776 = ] unit-test
-[ f ] [ test-file file-info other-execute? ] unit-test
+{ t } [ test-file f set-other-execute perms 0o776 = ] unit-test
+{ f } [ test-file file-info other-execute? ] unit-test
 
-[ t ] [ test-file f set-other-write perms 0o774 = ] unit-test
-[ f ] [ test-file file-info other-write? ] unit-test
+{ t } [ test-file f set-other-write perms 0o774 = ] unit-test
+{ f } [ test-file file-info other-write? ] unit-test
 
-[ t ] [ test-file f set-other-read perms 0o770 = ] unit-test
-[ f ] [ test-file file-info other-read? ] unit-test
+{ t } [ test-file f set-other-read perms 0o770 = ] unit-test
+{ f } [ test-file file-info other-read? ] unit-test
 
-[ t ] [ test-file f set-group-execute perms 0o760 = ] unit-test
-[ f ] [ test-file file-info group-execute? ] unit-test
+{ t } [ test-file f set-group-execute perms 0o760 = ] unit-test
+{ f } [ test-file file-info group-execute? ] unit-test
 
-[ t ] [ test-file f set-group-write perms 0o740 = ] unit-test
-[ f ] [ test-file file-info group-write? ] unit-test
+{ t } [ test-file f set-group-write perms 0o740 = ] unit-test
+{ f } [ test-file file-info group-write? ] unit-test
 
-[ t ] [ test-file f set-group-read perms 0o700 = ] unit-test
-[ f ] [ test-file file-info group-read? ] unit-test
+{ t } [ test-file f set-group-read perms 0o700 = ] unit-test
+{ f } [ test-file file-info group-read? ] unit-test
 
-[ t ] [ test-file f set-user-execute perms 0o600 = ] unit-test
-[ f ] [ test-file file-info other-execute? ] unit-test
+{ t } [ test-file f set-user-execute perms 0o600 = ] unit-test
+{ f } [ test-file file-info other-execute? ] unit-test
 
-[ t ] [ test-file f set-user-write perms 0o400 = ] unit-test
-[ f ] [ test-file file-info other-write? ] unit-test
+{ t } [ test-file f set-user-write perms 0o400 = ] unit-test
+{ f } [ test-file file-info other-write? ] unit-test
 
-[ t ] [ test-file f set-user-read perms 0o000 = ] unit-test
-[ f ] [ test-file file-info other-read? ] unit-test
+{ t } [ test-file f set-user-read perms 0o000 = ] unit-test
+{ f } [ test-file file-info other-read? ] unit-test
 
-[ t ]
+{ t }
 [ test-file flags{ USER-ALL GROUP-ALL OTHER-EXECUTE } set-file-permissions perms 0o771 = ] unit-test
 
 prepare-test-file
 
-[ t ]
+{ t }
 [
     test-file now
     [ set-file-access-time ] 2keep
@@ -97,7 +97,7 @@ prepare-test-file
     [ [ [ truncate >integer ] change-second >gmt ] bi@ ] bi* =
 ] unit-test
 
-[ t ]
+{ t }
 [
     test-file now
     [ set-file-modified-time ] 2keep
@@ -105,7 +105,7 @@ prepare-test-file
     [ [ [ truncate >integer ] change-second >gmt ] bi@ ] bi* =
 ] unit-test
 
-[ t ]
+{ t }
 [
     test-file now [ dup 2array set-file-times ] 2keep
     [ file-info [ modified>> ] [ accessed>> ] bi ] dip
@@ -113,53 +113,53 @@ prepare-test-file
     [ [ truncate >integer ] change-second >gmt ] map all-equal?
 ] unit-test
 
-[ ] [ test-file f now 2array set-file-times ] unit-test
-[ ] [ test-file now f 2array set-file-times ] unit-test
-[ ] [ test-file f f 2array set-file-times ] unit-test
+{ } [ test-file f now 2array set-file-times ] unit-test
+{ } [ test-file now f 2array set-file-times ] unit-test
+{ } [ test-file f f 2array set-file-times ] unit-test
 
 
-[ ] [ test-file real-user-name set-file-user ] unit-test
-[ ] [ test-file real-user-id set-file-user ] unit-test
-[ ] [ test-file real-group-name set-file-group ] unit-test
-[ ] [ test-file real-group-id set-file-group ] unit-test
+{ } [ test-file real-user-name set-file-user ] unit-test
+{ } [ test-file real-user-id set-file-user ] unit-test
+{ } [ test-file real-group-name set-file-group ] unit-test
+{ } [ test-file real-group-id set-file-group ] unit-test
 
-[ t ] [ test-file file-user-name real-user-name = ] unit-test
-[ t ] [ test-file file-group-name real-group-name = ] unit-test
+{ t } [ test-file file-user-name real-user-name = ] unit-test
+{ t } [ test-file file-group-name real-group-name = ] unit-test
 
-[ ]
+{ }
 [ test-file real-user-id real-group-id set-file-ids ] unit-test
 
-[ ]
+{ }
 [ test-file f real-group-id set-file-ids ] unit-test
 
-[ ]
+{ }
 [ test-file real-user-id f set-file-ids ] unit-test
 
-[ ]
+{ }
 [ test-file f f set-file-ids ] unit-test
 
-[ t ] [ 0o4000 uid? ] unit-test
-[ t ] [ 0o2000 gid? ] unit-test
-[ t ] [ 0o1000 sticky? ] unit-test
-[ t ] [ 0o400 user-read? ] unit-test
-[ t ] [ 0o200 user-write? ] unit-test
-[ t ] [ 0o100 user-execute? ] unit-test
-[ t ] [ 0o040 group-read? ] unit-test
-[ t ] [ 0o020 group-write? ] unit-test
-[ t ] [ 0o010 group-execute? ] unit-test
-[ t ] [ 0o004 other-read? ] unit-test
-[ t ] [ 0o002 other-write? ] unit-test
-[ t ] [ 0o001 other-execute? ] unit-test
-
-[ f ] [ 0 uid? ] unit-test
-[ f ] [ 0 gid? ] unit-test
-[ f ] [ 0 sticky? ] unit-test
-[ f ] [ 0 user-read? ] unit-test
-[ f ] [ 0 user-write? ] unit-test
-[ f ] [ 0 user-execute? ] unit-test
-[ f ] [ 0 group-read? ] unit-test
-[ f ] [ 0 group-write? ] unit-test
-[ f ] [ 0 group-execute? ] unit-test
-[ f ] [ 0 other-read? ] unit-test
-[ f ] [ 0 other-write? ] unit-test
-[ f ] [ 0 other-execute? ] unit-test
+{ t } [ 0o4000 uid? ] unit-test
+{ t } [ 0o2000 gid? ] unit-test
+{ t } [ 0o1000 sticky? ] unit-test
+{ t } [ 0o400 user-read? ] unit-test
+{ t } [ 0o200 user-write? ] unit-test
+{ t } [ 0o100 user-execute? ] unit-test
+{ t } [ 0o040 group-read? ] unit-test
+{ t } [ 0o020 group-write? ] unit-test
+{ t } [ 0o010 group-execute? ] unit-test
+{ t } [ 0o004 other-read? ] unit-test
+{ t } [ 0o002 other-write? ] unit-test
+{ t } [ 0o001 other-execute? ] unit-test
+
+{ f } [ 0 uid? ] unit-test
+{ f } [ 0 gid? ] unit-test
+{ f } [ 0 sticky? ] unit-test
+{ f } [ 0 user-read? ] unit-test
+{ f } [ 0 user-write? ] unit-test
+{ f } [ 0 user-execute? ] unit-test
+{ f } [ 0 group-read? ] unit-test
+{ f } [ 0 group-write? ] unit-test
+{ f } [ 0 group-execute? ] unit-test
+{ f } [ 0 other-read? ] unit-test
+{ f } [ 0 other-write? ] unit-test
+{ f } [ 0 other-execute? ] unit-test