2008-12-19 00:44:14 -05:00
|
|
|
USING: io.directories io.files.links tools.test sequences
|
2016-03-19 12:50:01 -04:00
|
|
|
io.files.temp io.files.unique tools.files fry math kernel
|
|
|
|
math.parser io.pathnames namespaces ;
|
2008-12-21 20:04:12 -05:00
|
|
|
IN: io.files.links.unix.tests
|
2008-12-18 19:32:00 -05:00
|
|
|
|
|
|
|
: make-test-links ( n path -- )
|
2010-01-14 10:10:13 -05:00
|
|
|
[ '[ [ 1 + ] keep [ number>string _ prepend ] bi@ make-link ] each-integer ]
|
2008-12-18 19:32:00 -05:00
|
|
|
[ [ number>string ] dip prepend touch-file ] 2bi ; inline
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ t } [
|
2008-12-18 19:32:00 -05:00
|
|
|
[
|
2016-03-18 13:57:54 -04:00
|
|
|
[
|
2009-01-26 16:05:15 -05:00
|
|
|
5 "lol" make-test-links
|
|
|
|
"lol1" follow-links
|
2016-03-18 13:57:54 -04:00
|
|
|
"lol5" absolute-path =
|
|
|
|
] cleanup-unique-directory
|
|
|
|
] with-temp-directory
|
2008-12-18 19:32:00 -05:00
|
|
|
] unit-test
|
|
|
|
|
|
|
|
[
|
|
|
|
[
|
2016-03-18 13:57:54 -04:00
|
|
|
[
|
2009-01-26 16:05:15 -05:00
|
|
|
100 "laf" make-test-links "laf1" follow-links
|
2016-03-18 13:57:54 -04:00
|
|
|
] with-unique-directory
|
|
|
|
] with-temp-directory
|
2008-12-18 19:32:00 -05:00
|
|
|
] [ too-many-symlinks? ] must-fail-with
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ t } [
|
2008-12-18 19:32:00 -05:00
|
|
|
110 symlink-depth [
|
|
|
|
[
|
2016-03-18 13:57:54 -04:00
|
|
|
[
|
2009-01-26 16:05:15 -05:00
|
|
|
100 "laf" make-test-links
|
|
|
|
"laf1" follow-links
|
2016-03-18 13:57:54 -04:00
|
|
|
"laf100" absolute-path =
|
|
|
|
] cleanup-unique-directory
|
|
|
|
] with-temp-directory
|
2008-12-18 19:32:00 -05:00
|
|
|
] with-variable
|
|
|
|
] unit-test
|