factor/extra/help/definitions/definitions-tests.factor

43 lines
1.3 KiB
Factor
Raw Normal View History

2007-09-20 18:09:08 -04:00
USING: math definitions help.topics help tools.test
prettyprint parser io.streams.string kernel source-files
assocs namespaces words io ;
IN: temporary
[ ] [ \ + >link see ] unit-test
[
file-vocabs
[ 4 ] [
"IN: temporary USING: help.syntax ; : hello ; HELP: hello \"test\" ; ARTICLE: \"hello\" \"world\" ; ARTICLE: \"hello2\" \"world\" ;" <string-reader> "foo"
parse-stream drop
2007-12-24 17:18:26 -05:00
"foo" source-file source-file-definitions first assoc-size
2007-09-20 18:09:08 -04:00
] unit-test
[ t ] [ "hello" articles get key? ] unit-test
[ t ] [ "hello2" articles get key? ] unit-test
[ t ] [
"hello" "temporary" lookup "help" word-prop >boolean
] unit-test
[ 2 ] [
"IN: temporary USING: help.syntax ; : hello ; ARTICLE: \"hello\" \"world\" ;" <string-reader> "foo"
parse-stream drop
2007-12-24 17:18:26 -05:00
"foo" source-file source-file-definitions first assoc-size
2007-09-20 18:09:08 -04:00
] unit-test
[ t ] [ "hello" articles get key? ] unit-test
[ f ] [ "hello2" articles get key? ] unit-test
[ f ] [
"hello" "temporary" lookup "help" word-prop
] unit-test
[ [ ] ] [ "IN: temporary USING: help.syntax ; : xxx ; HELP: xxx ;" parse ] unit-test
[ ] [ "xxx" "temporary" lookup help ] unit-test
[ ] [ "xxx" "temporary" lookup >link synopsis print ] unit-test
] with-scope