]> gitweb.factorcode.org Git - factor.git/blob - basis/help/crossref/crossref-tests.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / basis / help / crossref / crossref-tests.factor
1 USING: help.crossref help.topics help.markup tools.test words
2 definitions assocs sequences kernel namespaces parser arrays
3 io.streams.string continuations debugger compiler.units eval ;
4 IN: help.crossref.tests
5
6 [ ] [
7     "IN: help.crossref.tests USING: help.syntax help.markup ; : foo ( -- ) ; HELP: foo \"foo is great\" ; ARTICLE: \"foo\" \"Foo\" { $subsection foo } ;" eval( -- )
8 ] unit-test
9
10 [ $subsection ] [
11     "foo" article-content first first
12 ] unit-test
13
14 [ t ] [
15     "foo" article-children
16     "foo" "help.crossref.tests" lookup >link 1array sequence=
17 ] unit-test
18
19 [ "foo" ] [ "foo" "help.crossref.tests" lookup article-parent ] unit-test
20
21 [ ] [
22     [ "foo" "help.crossref.tests" lookup forget ] with-compilation-unit
23 ] unit-test
24
25 [ ] [
26     "IN: help.crossref.tests USING: help.syntax help.markup ; : bar ( -- ) ; HELP: bar \"bar is great\" ; ARTICLE: \"bar\" \"Bar\" { $subsection bar } ;" eval( -- )
27 ] unit-test
28
29 [ ] [
30     "IN: ayy USE: help.syntax ARTICLE: \"b\" \"B\" ;"
31     <string-reader> "ayy" parse-stream drop
32 ] unit-test
33
34 [ ] [
35     "IN: azz USE: help.syntax USE: help.markup ARTICLE: \"a\" \"A\" { $subsection \"b\" } ;"
36     <string-reader> "ayy" parse-stream drop
37 ] unit-test
38
39 [ ] [
40     "IN: ayy USE: help.syntax ARTICLE: \"c\" \"C\" ;"
41     <string-reader> "ayy" parse-stream drop
42 ] unit-test
43
44 [ ] [
45     "IN: azz USE: help.syntax USE: help.markup ARTICLE: \"a\" \"A\" { $subsection \"c\" } ;"
46     <string-reader> "ayy" parse-stream drop
47 ] unit-test
48
49 [ ] [
50     [
51         "IN: azz USE: help.syntax USE: help.markup ARTICLE: \"yyy\" \"YYY\" ; ARTICLE: \"xxx\" \"XXX\" { $subsection \"yyy\" } ; ARTICLE: \"yyy\" \"YYY\" ;"
52         <string-reader> "parent-test" parse-stream drop
53     ] [ :1 ] recover
54 ] unit-test
55
56 [ "xxx" ] [ "yyy" article-parent ] unit-test