]> gitweb.factorcode.org Git - factor.git/blob - basis/help/definitions/definitions-tests.factor
1b8bcccce7e18851e2e507dfbbe6a7addc420942
[factor.git] / basis / help / definitions / definitions-tests.factor
1 USING: math definitions help.topics help tools.test
2 prettyprint parser io.streams.string kernel source-files
3 assocs namespaces words io sequences eval accessors ;
4 IN: help.definitions.tests
5
6 [ ] [ \ + >link see ] unit-test
7
8 [
9     [ 4 ] [
10         "IN: help.definitions.tests USING: help.syntax ; : hello ; HELP: hello \"test\" ; ARTICLE: \"hello\" \"world\" ; ARTICLE: \"hello2\" \"world\" ;" <string-reader> "foo"
11         parse-stream drop
12
13         "foo" source-file definitions>> first assoc-size
14     ] unit-test
15
16     [ t ] [ "hello" articles get key? ] unit-test
17     [ t ] [ "hello2" articles get key? ] unit-test
18     [ t ] [
19         "hello" "help.definitions.tests" lookup "help" word-prop >boolean
20     ] unit-test
21
22     [ 2 ] [
23         "IN: help.definitions.tests USING: help.syntax ; : hello ; ARTICLE: \"hello\" \"world\" ;" <string-reader> "foo"
24         parse-stream drop
25
26         "foo" source-file definitions>> first assoc-size
27     ] unit-test
28
29     [ t ] [ "hello" articles get key? ] unit-test
30     [ f ] [ "hello2" articles get key? ] unit-test
31     [ f ] [
32         "hello" "help.definitions.tests" lookup "help" word-prop
33     ] unit-test
34
35     [ ] [ "IN: help.definitions.tests USING: help.syntax ; : xxx ; HELP: xxx ;" eval ] unit-test
36
37     [ ] [ "xxx" "help.definitions.tests" lookup help ] unit-test
38
39     [ ] [ "xxx" "help.definitions.tests" lookup >link synopsis print ] unit-test
40 ] with-file-vocabs