]> gitweb.factorcode.org Git - factor.git/blob - basis/io/files/links/links-tests.factor
Merge commit 'origin/master'
[factor.git] / basis / io / files / links / links-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.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         5 "lol" make-test-links
13         "lol1" follow-links
14         current-directory get "lol5" append-path =
15     ] with-unique-directory
16 ] unit-test
17
18 [
19     [
20         100 "laf" make-test-links "laf1" follow-links
21     ] with-unique-directory
22 ] [ too-many-symlinks? ] must-fail-with
23
24 [ t ] [
25     110 symlink-depth [
26         [
27             100 "laf" make-test-links
28             "laf1" follow-links
29             current-directory get "laf100" append-path =
30         ] with-unique-directory
31     ] with-variable
32 ] unit-test