]> gitweb.factorcode.org Git - factor.git/blob - core/vocabs/vocabs-tests.factor
factor: Retrying on the unit tests. Also normalize some syntax with FUNCTION:.
[factor.git] / core / vocabs / vocabs-tests.factor
1 ! Unit tests for vocabs vocabulary
2 USING: vocabs tools.test ;
3 IN: vocabs.tests
4
5 { f } [ "kernel" vocab-main ] unit-test
6
7 { t } [ "" "" child-vocab? ] unit-test
8 { t } [ "" "io.files" child-vocab? ] unit-test
9 { t } [ "io" "io.files" child-vocab? ] unit-test
10 { f } [ "io.files" "io" child-vocab? ] unit-test
11
12 [ "foo/bar" create-vocab ] [ bad-vocab-name? ] must-fail-with
13 [ "foo\\bar" create-vocab ] [ bad-vocab-name? ] must-fail-with
14 [ "foo:bar" create-vocab ] [ bad-vocab-name? ] must-fail-with
15 [ 3 create-vocab ] [ bad-vocab-name? ] must-fail-with
16 [ f create-vocab ] [ bad-vocab-name? ] must-fail-with
17 [ "a b" create-vocab ] [ bad-vocab-name? ] must-fail-with
18
19 [ "foo/bar" lookup-vocab ] [ bad-vocab-name? ] must-fail-with
20 [ "foo\\bar" lookup-vocab ] [ bad-vocab-name? ] must-fail-with
21 [ "foo:bar" lookup-vocab ] [ bad-vocab-name? ] must-fail-with
22 [ 3 lookup-vocab ] [ bad-vocab-name? ] must-fail-with
23 [ f lookup-vocab ] [ bad-vocab-name? ] must-fail-with
24 [ "a b" lookup-vocab ] [ bad-vocab-name? ] must-fail-with
25
26 [ "foo/bar" >vocab-link lookup-vocab ] [ bad-vocab-name? ] must-fail-with
27 [ "foo\\bar" >vocab-link lookup-vocab ] [ bad-vocab-name? ] must-fail-with
28 [ "foo:bar" >vocab-link lookup-vocab ] [ bad-vocab-name? ] must-fail-with
29 [ 3 >vocab-link lookup-vocab ] [ bad-vocab-name? ] must-fail-with
30 [ f >vocab-link lookup-vocab ] [ bad-vocab-name? ] must-fail-with
31 [ "a b" >vocab-link lookup-vocab ] [ bad-vocab-name? ] must-fail-with
32
33 [ "sojoijsaoifjsthisdoesntexistomgomgomgplznodontexist" require ]
34 [ no-vocab? ] must-fail-with
35
36 [ "letstrythisagainnooooooyoucantexistnoooooo" load-vocab ]
37 [ no-vocab? ] must-fail-with