globs: more tests.

locals-and-roots
John Benediktsson 2016-03-27 20:50:13 -07:00
parent 5f11bf63b6
commit 1dd9a73ae8
1 changed files with 18 additions and 12 deletions

View File

@ -1,5 +1,6 @@
USING: globs io.directories io.files.temp io.files.unique
io.pathnames literals sequences tools.test ;
USING: globs globs.private io.directories io.files.temp
io.files.unique io.pathnames literals sequences sorting
tools.test ;
IN: globs.tests
{ f } [ "abd" "fdf" glob-matches? ] unit-test
@ -33,6 +34,11 @@ IN: globs.tests
{ t } [ "fo\\*" 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/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/e" touch-file
"**" glob-directory
"**/" glob-directory
"**/*" glob-directory
"**/**" glob-directory
"**/b" glob-directory
"**/e" glob-directory
! "**//e" glob-directory
! "**/**/e" glob-directory
"**/e/**" glob-directory
"a/**" glob-directory
"**" glob-directory natural-sort
"**/" glob-directory natural-sort
"**/*" glob-directory natural-sort
"**/**" glob-directory natural-sort
"**/b" glob-directory natural-sort
"**/e" glob-directory natural-sort
! "**//e" glob-directory natural-sort
! "**/**/e" glob-directory natural-sort
"**/e/**" glob-directory natural-sort
"a/**" glob-directory natural-sort
] cleanup-unique-directory
] with-temp-directory
] unit-test