factor/basis/help/definitions/definitions-tests.factor

41 lines
1.4 KiB
Factor
Raw Normal View History

USING: math definitions help.topics help tools.test sets
2007-09-20 18:09:08 -04:00
prettyprint parser io.streams.string kernel source-files
assocs namespaces words io sequences eval accessors see ;
2008-03-01 17:00:45 -05:00
IN: help.definitions.tests
2007-09-20 18:09:08 -04:00
{ } [ \ + >link see ] unit-test
2007-09-20 18:09:08 -04:00
[
[ 4 ] [
2009-03-23 01:34:02 -04:00
"IN: help.definitions.tests USING: help.syntax ; : hello ( -- ) ; HELP: hello \"test\" ; ARTICLE: \"hello\" \"world\" ; ARTICLE: \"hello2\" \"world\" ;" <string-reader> "foo"
2007-09-20 18:09:08 -04:00
parse-stream drop
"foo" source-file definitions>> first cardinality
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 ] [
2011-11-06 18:57:24 -05:00
"hello" "help.definitions.tests" lookup-word "help" word-prop >boolean
2007-09-20 18:09:08 -04:00
] unit-test
[ 2 ] [
2009-03-23 01:34:02 -04:00
"IN: help.definitions.tests USING: help.syntax ; : hello ( -- ) ; ARTICLE: \"hello\" \"world\" ;" <string-reader> "foo"
2007-09-20 18:09:08 -04:00
parse-stream drop
"foo" source-file definitions>> first cardinality
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 ] [
2011-11-06 18:57:24 -05:00
"hello" "help.definitions.tests" lookup-word "help" word-prop
2007-09-20 18:09:08 -04:00
] unit-test
2009-04-17 16:49:21 -04:00
[ ] [ "IN: help.definitions.tests USING: help.syntax ; : xxx ( -- ) ; HELP: xxx ;" eval( -- ) ] unit-test
2007-09-20 18:09:08 -04:00
2011-11-06 18:57:24 -05:00
[ ] [ "xxx" "help.definitions.tests" lookup-word print-topic ] unit-test
2007-09-20 18:09:08 -04:00
2011-11-06 18:57:24 -05:00
[ ] [ "xxx" "help.definitions.tests" lookup-word >link synopsis print ] unit-test
2007-12-30 17:14:15 -05:00
] with-file-vocabs