]> gitweb.factorcode.org Git - factor.git/blob - core/vocabs/parser/parser-tests.factor
core: Rename create to create-word, create-in to create-word-in.
[factor.git] / core / vocabs / parser / parser-tests.factor
1 IN: vocabs.parser.tests
2 USING: vocabs.parser tools.test eval kernel accessors definitions
3 compiler.units words vocabs ;
4
5 [ "FROM: kernel => doesnotexist ;" eval( -- ) ]
6 [ error>> T{ no-word-in-vocab { word "doesnotexist" } { vocab "kernel" } } = ]
7 must-fail-with
8
9 [ "RENAME: doesnotexist kernel => newname" eval( -- ) ]
10 [ error>> T{ no-word-in-vocab { word "doesnotexist" } { vocab "kernel" } } = ]
11 must-fail-with
12
13 : aaa ( -- ) ;
14
15 [
16     [ ] [ "aaa" "vocabs.parser.tests" "uutt" add-renamed-word ] unit-test
17
18     [ ] [ "vocabs.parser.tests" dup add-qualified ] unit-test
19
20     [ aaa ] [ "uutt" search ] unit-test
21     [ aaa ] [ "vocabs.parser.tests:aaa" search ] unit-test
22
23     [ ] [ [ "bbb" "vocabs.parser.tests" create-word drop ] with-compilation-unit ] unit-test
24
25     [ "bbb" ] [ "vocabs.parser.tests:bbb" search name>> ] unit-test
26
27     [ ] [ [ \ aaa forget ] with-compilation-unit ] unit-test
28
29     [ ] [ [ "bbb" "vocabs.parser.tests" lookup-word forget ] with-compilation-unit ] unit-test
30
31     [ f ] [ "uutt" search ] unit-test
32
33     [ f ] [ "vocabs.parser.tests:aaa" search ] unit-test
34
35     [ ] [ "vocabs.parser.tests.foo" set-current-vocab ] unit-test
36
37     [ ] [ [ "bbb" current-vocab create-word drop ] with-compilation-unit ] unit-test
38
39     [ t ] [ "bbb" search >boolean ] unit-test
40
41     [ ] [ [ "vocabs.parser.tests.foo" forget-vocab ] with-compilation-unit ] unit-test
42
43     [ [ "bbb" current-vocab create-word drop ] with-compilation-unit ] [ error>> no-current-vocab-error? ] must-fail-with
44
45     [ begin-private ] [ error>> no-current-vocab-error? ] must-fail-with
46
47     [ end-private ] [ error>> no-current-vocab-error? ] must-fail-with
48
49     [ f ] [ "bbb" search >boolean ] unit-test
50
51 ] with-manifest