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