]> gitweb.factorcode.org Git - factor.git/blob - basis/io/files/links/unix/unix-tests.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / basis / io / files / links / unix / unix-tests.factor
1 USING: io.directories io.files.links tools.test sequences
2 io.files.unique tools.files fry math kernel math.parser
3 io.pathnames namespaces ;
4 IN: io.files.links.unix.tests
5
6 : make-test-links ( n path -- )
7     [ '[ [ 1 + ] keep [ number>string _ prepend ] bi@ make-link ] each ]
8     [ [ number>string ] dip prepend touch-file ] 2bi ; inline
9
10 [ t ] [
11     [
12         current-temporary-directory get [
13             5 "lol" make-test-links
14             "lol1" follow-links
15             current-temporary-directory get "lol5" append-path =
16         ] with-directory
17     ] cleanup-unique-directory
18 ] unit-test
19
20 [
21     [
22         current-temporary-directory get [
23             100 "laf" make-test-links "laf1" follow-links
24         ] with-directory
25     ] with-unique-directory
26 ] [ too-many-symlinks? ] must-fail-with
27
28 [ t ] [
29     110 symlink-depth [
30         [
31             current-temporary-directory get [
32                 100 "laf" make-test-links
33                 "laf1" follow-links
34                 current-temporary-directory get "laf100" append-path =
35             ] with-directory
36         ] cleanup-unique-directory
37     ] with-variable
38 ] unit-test