globs: more tests.
parent
5f11bf63b6
commit
1dd9a73ae8
|
@ -1,5 +1,6 @@
|
||||||
USING: globs io.directories io.files.temp io.files.unique
|
USING: globs globs.private io.directories io.files.temp
|
||||||
io.pathnames literals sequences tools.test ;
|
io.files.unique io.pathnames literals sequences sorting
|
||||||
|
tools.test ;
|
||||||
IN: globs.tests
|
IN: globs.tests
|
||||||
|
|
||||||
{ f } [ "abd" "fdf" glob-matches? ] unit-test
|
{ f } [ "abd" "fdf" glob-matches? ] unit-test
|
||||||
|
@ -33,6 +34,11 @@ IN: globs.tests
|
||||||
{ t } [ "fo\\*" glob-pattern? ] unit-test
|
{ t } [ "fo\\*" glob-pattern? ] unit-test
|
||||||
{ t } [ "fo{o,bro}" glob-pattern? ] unit-test
|
{ t } [ "fo{o,bro}" glob-pattern? ] unit-test
|
||||||
|
|
||||||
|
{ "a/b/c" { } } [ "a/b/c" split-glob ] unit-test
|
||||||
|
{ "a/b" { "c*" } } [ "a/b/c*" split-glob ] unit-test
|
||||||
|
{ "a/b" { "c*" "" } } [ "a/b/c*/" split-glob ] unit-test
|
||||||
|
{ "/path/to" { "a?" } } [ "/path/to/a?" split-glob ] unit-test
|
||||||
|
|
||||||
{
|
{
|
||||||
{ "a" }
|
{ "a" }
|
||||||
{ "a" "a/b" "a/b/c" "a/b/c/d" "a/b/h" "a/e" "a/e/g" }
|
{ "a" "a/b" "a/b/c" "a/b/c/d" "a/b/h" "a/e" "a/e/g" }
|
||||||
|
@ -70,16 +76,16 @@ IN: globs.tests
|
||||||
"a/e/g" make-directory
|
"a/e/g" make-directory
|
||||||
"a/e/g/e" touch-file
|
"a/e/g/e" touch-file
|
||||||
|
|
||||||
"**" glob-directory
|
"**" glob-directory natural-sort
|
||||||
"**/" glob-directory
|
"**/" glob-directory natural-sort
|
||||||
"**/*" glob-directory
|
"**/*" glob-directory natural-sort
|
||||||
"**/**" glob-directory
|
"**/**" glob-directory natural-sort
|
||||||
"**/b" glob-directory
|
"**/b" glob-directory natural-sort
|
||||||
"**/e" glob-directory
|
"**/e" glob-directory natural-sort
|
||||||
! "**//e" glob-directory
|
! "**//e" glob-directory natural-sort
|
||||||
! "**/**/e" glob-directory
|
! "**/**/e" glob-directory natural-sort
|
||||||
"**/e/**" glob-directory
|
"**/e/**" glob-directory natural-sort
|
||||||
"a/**" glob-directory
|
"a/**" glob-directory natural-sort
|
||||||
] cleanup-unique-directory
|
] cleanup-unique-directory
|
||||||
] with-temp-directory
|
] with-temp-directory
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
Loading…
Reference in New Issue