2015-07-02 17:56:14 -04:00
|
|
|
USING: globs io.pathnames literals sequences tools.test ;
|
2009-08-13 20:21:44 -04:00
|
|
|
IN: globs.tests
|
2007-11-28 02:12:42 -05:00
|
|
|
|
2015-07-02 20:28:17 -04:00
|
|
|
{ f } [ "abd" "fdf" glob-matches? ] unit-test
|
|
|
|
{ f } [ "fdsafas" "?" glob-matches? ] unit-test
|
|
|
|
{ t } [ "fdsafas" "*as" glob-matches? ] unit-test
|
|
|
|
{ t } [ "fdsafas" "*a*" glob-matches? ] unit-test
|
|
|
|
{ t } [ "fdsafas" "*a?" glob-matches? ] unit-test
|
|
|
|
{ t } [ "fdsafas" "*?" glob-matches? ] unit-test
|
|
|
|
{ f } [ "fdsafas" "*s?" glob-matches? ] unit-test
|
|
|
|
{ t } [ "a" "[abc]" glob-matches? ] unit-test
|
|
|
|
{ f } [ "a" "[^abc]" glob-matches? ] unit-test
|
|
|
|
{ t } [ "d" "[^abc]" glob-matches? ] unit-test
|
|
|
|
{ f } [ "foo.java" "*.{xml,txt}" glob-matches? ] unit-test
|
|
|
|
{ t } [ "foo.txt" "*.{xml,txt}" glob-matches? ] unit-test
|
|
|
|
{ t } [ "foo.xml" "*.{xml,txt}" glob-matches? ] unit-test
|
|
|
|
{ f } [ "foo." "*.{xml,txt}" glob-matches? ] unit-test
|
|
|
|
{ t } [ "foo." "*.{,xml,txt}" glob-matches? ] unit-test
|
|
|
|
{ t } [ "foo.{" "*.{" glob-matches? ] unit-test
|
2010-02-13 16:35:04 -05:00
|
|
|
|
2015-07-02 20:28:17 -04:00
|
|
|
{ f } [ "foo" "bar" append-path "*" glob-matches? ] unit-test
|
|
|
|
{ t } [ "foo" "bar" append-path "*" "*" append-path glob-matches? ] unit-test
|
|
|
|
{ f } [ "foo" "bar" append-path "foo?bar" glob-matches? ] unit-test
|
|
|
|
{ t } [ "foo" "bar" append-path "fo?" "bar" append-path glob-matches? ] unit-test
|
2010-02-14 14:49:33 -05:00
|
|
|
|
2015-07-02 20:28:17 -04:00
|
|
|
{ f } [ "foo" glob-pattern? ] unit-test
|
|
|
|
{ t } [ "fo?" glob-pattern? ] unit-test
|
|
|
|
{ t } [ "fo*" glob-pattern? ] unit-test
|
|
|
|
{ t } [ "fo[mno]" glob-pattern? ] unit-test
|
|
|
|
{ t } [ "fo\\*" glob-pattern? ] unit-test
|
|
|
|
{ t } [ "fo{o,bro}" glob-pattern? ] unit-test
|
2010-02-14 14:49:33 -05:00
|
|
|
|
2015-07-02 17:56:14 -04:00
|
|
|
${ { "foo" "bar" } path-separator join }
|
2010-02-14 14:49:33 -05:00
|
|
|
[ { "foo" "bar" "ba?" } path-separator join glob-parent-directory ] unit-test
|
|
|
|
|
2015-07-02 20:28:17 -04:00
|
|
|
{ "foo" }
|
2010-02-14 14:49:33 -05:00
|
|
|
[ { "foo" "b?r" "bas" } path-separator join glob-parent-directory ] unit-test
|
|
|
|
|
2015-07-02 20:28:17 -04:00
|
|
|
{ "" }
|
2010-02-14 14:49:33 -05:00
|
|
|
[ { "f*" "bar" "bas" } path-separator join glob-parent-directory ] unit-test
|