]> gitweb.factorcode.org Git - factor.git/blob - basis/vocabs/metadata/resources/resources-tests.factor
d6fea4ca363d0cd8499d654f52230d08a97ec25a
[factor.git] / basis / vocabs / metadata / resources / resources-tests.factor
1 ! (c)2010 Joe Groff bsd license
2 USING: arrays globs sorting tools.test vocabs.metadata.resources ;
3 IN: vocabs.metadata.resources.tests
4
5 ! match-pattern
6 { { "hello.txt" } } [
7     "*.txt" { "hello.txt" } match-pattern
8 ] unit-test
9
10 [
11     "*.txt" { "foo.bar" "foo.factor" } match-pattern
12 ] [ resource-missing? ] must-fail-with
13
14 ! match-patterns
15 {
16     { "a.txt" "b.pdf" }
17 } [
18     { "*.txt" "*.pdf" } { "a.txt" "b.pdf" "a" } match-patterns
19 ] unit-test
20
21 ! vocab-resource-files
22 { { "bar" "bas" "foo" } }
23 [ "vocabs.metadata.resources.test.1" vocab-resource-files natural-sort ] unit-test
24
25 { { "bar.wtf" "foo.wtf" } }
26 [ "vocabs.metadata.resources.test.2" vocab-resource-files natural-sort ] unit-test
27
28 {
29     {
30         "resource-dir"
31         "resource-dir/bar"
32         "resource-dir/bas"
33         "resource-dir/bas/zang"
34         "resource-dir/bas/zim"
35         "resource-dir/foo"
36     }
37 } [
38     "vocabs.metadata.resources.test.3" vocab-resource-files natural-sort
39 ] unit-test