]> gitweb.factorcode.org Git - factor.git/blob - basis/io/files/links/unix/unix-tests.factor
ui.listener: document that ~/.factor-history persists input history
[factor.git] / basis / io / files / links / unix / unix-tests.factor
1 USING: fry io.directories io.files.links io.pathnames kernel
2 math math.parser namespaces sequences tools.test ;
3 IN: io.files.links.unix.tests
4
5 : make-test-links ( n path -- )
6     [ '[ [ 1 + ] keep [ number>string _ prepend ] bi@ make-link ] each-integer ]
7     [ [ number>string ] dip prepend touch-file ] 2bi ; inline
8
9 { t } [
10     [
11         5 "lol" make-test-links
12         "lol1" follow-links
13         "lol5" absolute-path =
14     ] with-test-directory
15 ] unit-test
16
17 [
18     [
19         100 "laf" make-test-links "laf1" follow-links
20     ] with-test-directory
21 ] [ too-many-symlinks? ] must-fail-with
22
23 { t } [
24     110 symlink-depth [
25         [
26             100 "laf" make-test-links
27             "laf1" follow-links
28             "laf100" absolute-path =
29         ] with-test-directory
30     ] with-variable
31 ] unit-test