2017-08-25 18:34:26 -04:00
|
|
|
! Copyright (C) 2010 Joe Groff.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2016-09-12 23:29:15 -04:00
|
|
|
USING: arrays globs sorting tools.test vocabs.metadata.resources ;
|
2010-02-13 17:15:27 -05:00
|
|
|
IN: vocabs.metadata.resources.tests
|
|
|
|
|
2016-09-13 00:07:14 -04:00
|
|
|
! match-pattern
|
2016-09-12 23:29:15 -04:00
|
|
|
{ { "hello.txt" } } [
|
2016-09-13 00:07:14 -04:00
|
|
|
"*.txt" { "hello.txt" } match-pattern
|
2016-09-12 23:29:15 -04:00
|
|
|
] unit-test
|
|
|
|
|
2016-09-13 00:07:14 -04:00
|
|
|
[
|
|
|
|
"*.txt" { "foo.bar" "foo.factor" } match-pattern
|
|
|
|
] [ resource-missing? ] must-fail-with
|
|
|
|
|
2016-11-26 03:40:54 -05:00
|
|
|
! match-patterns
|
|
|
|
{
|
|
|
|
{ "a.txt" "b.pdf" }
|
|
|
|
} [
|
|
|
|
{ "*.txt" "*.pdf" } { "a.txt" "b.pdf" "a" } match-patterns
|
|
|
|
] unit-test
|
|
|
|
|
2016-09-12 23:29:15 -04:00
|
|
|
! vocab-resource-files
|
2015-07-03 12:39:59 -04:00
|
|
|
{ { "bar" "bas" "foo" } }
|
2010-02-13 17:15:27 -05:00
|
|
|
[ "vocabs.metadata.resources.test.1" vocab-resource-files natural-sort ] unit-test
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ { "bar.wtf" "foo.wtf" } }
|
2010-02-13 17:15:27 -05:00
|
|
|
[ "vocabs.metadata.resources.test.2" vocab-resource-files natural-sort ] unit-test
|
|
|
|
|
2016-09-12 23:29:15 -04:00
|
|
|
{
|
|
|
|
{
|
|
|
|
"resource-dir"
|
|
|
|
"resource-dir/bar"
|
|
|
|
"resource-dir/bas"
|
|
|
|
"resource-dir/bas/zang"
|
|
|
|
"resource-dir/bas/zim"
|
|
|
|
"resource-dir/foo"
|
|
|
|
}
|
|
|
|
} [
|
|
|
|
"vocabs.metadata.resources.test.3" vocab-resource-files natural-sort
|
|
|
|
] unit-test
|