mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 11:24:21 +03:00
dprint: simplify arm doc testing
This commit is contained in:
parent
5710826cd4
commit
37ce546dd4
@ -15,7 +15,7 @@
|
|||||||
++ empty ~
|
++ empty ~
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
:> arms used for testing arm documentation
|
:> arms used for testing doccords
|
||||||
|% %test-arms
|
|% %test-arms
|
||||||
+| %types
|
+| %types
|
||||||
+$ arm-dox [tape what what what]
|
+$ arm-dox [tape what what what]
|
||||||
@ -49,6 +49,74 @@
|
|||||||
?> ?=([%chapter *] itm)
|
?> ?=([%chapter *] itm)
|
||||||
[name docs]:itm
|
[name docs]:itm
|
||||||
::
|
::
|
||||||
|
++ arm-check
|
||||||
|
|= [arms=(list term) dox=(trel ? ? ?)]
|
||||||
|
=+ [adoc pdoc cdoc]=[`['arm-doc' ~] `['product-doc' ~] `['core-doc' ~]]
|
||||||
|
^- tang
|
||||||
|
=| res=tang
|
||||||
|
|-
|
||||||
|
?~ arms res
|
||||||
|
%= $
|
||||||
|
arms t.arms
|
||||||
|
res %+ weld
|
||||||
|
res
|
||||||
|
%+ expect-eq
|
||||||
|
!> ^- arm-dox
|
||||||
|
:* (trip i.arms)
|
||||||
|
?:(p.dox adoc *what)
|
||||||
|
?:(q.dox pdoc *what)
|
||||||
|
?:(r.dox cdoc *what)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
!> (get-arm-dox ~[i.arms])
|
||||||
|
==
|
||||||
|
::
|
||||||
|
++ run-arm-tests
|
||||||
|
|= [dox=(trel ? ? ?)]
|
||||||
|
^- tang
|
||||||
|
=/ num (sub 3 :(add p.dox q.dox r.dox))
|
||||||
|
=/ prefix=term
|
||||||
|
;: (cury cat 3)
|
||||||
|
%arm-
|
||||||
|
?:(p.dox %adoc- ~)
|
||||||
|
?:(q.dox %pdoc- ~)
|
||||||
|
?:(r.dox %cdoc- ~)
|
||||||
|
==
|
||||||
|
=/ posts=(list term)
|
||||||
|
?+ num ~
|
||||||
|
%1 ~[%pre %post]
|
||||||
|
%2 ~[%pre-pre %post-pre %post-post]
|
||||||
|
%3 :~ %pre-pre-pre
|
||||||
|
%pre-pre-post
|
||||||
|
%pre-post-pre
|
||||||
|
%post-pre-pre
|
||||||
|
%pre-post-post
|
||||||
|
%post-pre-post
|
||||||
|
%post-post-pre
|
||||||
|
==
|
||||||
|
==
|
||||||
|
%+ arm-check
|
||||||
|
%+ turn posts
|
||||||
|
|= [postfix=term]
|
||||||
|
`term`(cat 3 prefix postfix)
|
||||||
|
dox
|
||||||
|
::
|
||||||
|
+| %batch-comments
|
||||||
|
:> +foo: a foo
|
||||||
|
:> +bar: a bar
|
||||||
|
:> a very bar foo
|
||||||
|
:> $baz: a baz
|
||||||
|
:> $boz: a boz
|
||||||
|
:> a very boz baz
|
||||||
|
:> +foobar: a foobar
|
||||||
|
:> $bazboz: a bazbor
|
||||||
|
++ foo ~
|
||||||
|
++ bar ~
|
||||||
|
+$ baz *
|
||||||
|
+$ boz *
|
||||||
|
++ foobar [~ ~]
|
||||||
|
+$ bazboz [* *]
|
||||||
|
::
|
||||||
+| %docs-for-arms
|
+| %docs-for-arms
|
||||||
++ no-doc ~
|
++ no-doc ~
|
||||||
::
|
::
|
||||||
@ -185,6 +253,12 @@
|
|||||||
::
|
::
|
||||||
:> contains the actual tests to be run by -test
|
:> contains the actual tests to be run by -test
|
||||||
|% %dprint-tests
|
|% %dprint-tests
|
||||||
|
:: +| %batch-tests
|
||||||
|
:: ++ test-b-foo
|
||||||
|
:: %+ expect-eq
|
||||||
|
:: !>
|
||||||
|
+| %arm-tests
|
||||||
|
::
|
||||||
++ test-no-doc
|
++ test-no-doc
|
||||||
%+ expect-eq
|
%+ expect-eq
|
||||||
!> ^- arm-dox
|
!> ^- arm-dox
|
||||||
@ -192,180 +266,15 @@
|
|||||||
::
|
::
|
||||||
!> (get-arm-dox ~[%no-doc])
|
!> (get-arm-dox ~[%no-doc])
|
||||||
::
|
::
|
||||||
++ test-adoc
|
++ test-adoc (run-arm-tests & | |)
|
||||||
;: weld
|
++ test-pdoc (run-arm-tests | & |)
|
||||||
%+ expect-eq
|
++ test-cdoc (run-arm-tests | | &)
|
||||||
!> ^- arm-dox
|
++ test-adoc-pdoc (run-arm-tests & & |)
|
||||||
["arm-adoc-pre" `['arm-doc' ~] *what *what]
|
++ test-adoc-cdoc (run-arm-tests & | &)
|
||||||
::
|
++ test-pdoc-cdoc (run-arm-tests | & &)
|
||||||
!> (get-arm-dox ~[%arm-adoc-pre])
|
++ test-adoc-pdoc-cdoc (run-arm-tests & & &)
|
||||||
::
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
["arm-adoc-post" `['arm-doc' ~] *what *what]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-adoc-post])
|
|
||||||
==
|
|
||||||
::
|
|
||||||
++ test-pdoc
|
|
||||||
;: weld
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
["arm-pdoc-pre" *what `['product-doc' ~] *what]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-pdoc-pre])
|
|
||||||
::
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
["arm-pdoc-post" *what `['product-doc' ~] *what]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-pdoc-post])
|
|
||||||
==
|
|
||||||
::
|
|
||||||
++ test-cdoc
|
|
||||||
;: weld
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
["arm-cdoc-pre" *what *what `['core-doc' ~]]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-cdoc-pre])
|
|
||||||
::
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
["arm-cdoc-post" *what *what `['core-doc' ~]]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-cdoc-post])
|
|
||||||
==
|
|
||||||
::
|
|
||||||
++ test-adoc-pdoc
|
|
||||||
;: weld
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
["arm-adoc-pdoc-pre-pre" `['arm-doc' ~] `['product-doc' ~] *what]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-adoc-pdoc-pre-pre])
|
|
||||||
::
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
["arm-adoc-pdoc-post-pre" `['arm-doc' ~] `['product-doc' ~] *what]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-adoc-pdoc-post-pre])
|
|
||||||
::
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
["arm-adoc-pdoc-post-post" `['arm-doc' ~] `['product-doc' ~] *what]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-adoc-pdoc-post-post])
|
|
||||||
==
|
|
||||||
::
|
|
||||||
++ test-adoc-cdoc
|
|
||||||
;: weld
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
["arm-adoc-cdoc-pre-pre" `['arm-doc' ~] *what `['core-doc' ~]]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-adoc-cdoc-pre-pre])
|
|
||||||
::
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
["arm-adoc-cdoc-post-pre" `['arm-doc' ~] *what `['core-doc' ~]]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-adoc-cdoc-post-pre])
|
|
||||||
::
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
["arm-adoc-cdoc-post-post" `['arm-doc' ~] *what `['core-doc' ~]]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-adoc-cdoc-post-post])
|
|
||||||
==
|
|
||||||
::
|
|
||||||
++ test-pdoc-cdoc
|
|
||||||
;: weld
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
["arm-pdoc-cdoc-pre-pre" *what `['product-doc' ~] `['core-doc' ~]]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-pdoc-cdoc-pre-pre])
|
|
||||||
::
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
["arm-pdoc-cdoc-post-pre" *what `['product-doc' ~] `['core-doc' ~]]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-pdoc-cdoc-post-pre])
|
|
||||||
::
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
["arm-pdoc-cdoc-post-post" *what `['product-doc' ~] `['core-doc' ~]]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-pdoc-cdoc-post-post])
|
|
||||||
==
|
|
||||||
::
|
|
||||||
++ test-adoc-pdoc-cdoc
|
|
||||||
;: weld
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
:^ "arm-adoc-pdoc-cdoc-pre-pre-pre"
|
|
||||||
`['arm-doc' ~]
|
|
||||||
`['product-doc' ~]
|
|
||||||
`['core-doc' ~]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-adoc-pdoc-cdoc-pre-pre-pre])
|
|
||||||
::
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
:^ "arm-adoc-pdoc-cdoc-post-pre-pre"
|
|
||||||
`['arm-doc' ~]
|
|
||||||
`['product-doc' ~]
|
|
||||||
`['core-doc' ~]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-adoc-pdoc-cdoc-post-pre-pre])
|
|
||||||
::
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
:^ "arm-adoc-pdoc-cdoc-pre-post-pre"
|
|
||||||
`['arm-doc' ~]
|
|
||||||
`['product-doc' ~]
|
|
||||||
`['core-doc' ~]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-adoc-pdoc-cdoc-pre-post-pre])
|
|
||||||
::
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
:^ "arm-adoc-pdoc-cdoc-pre-pre-post"
|
|
||||||
`['arm-doc' ~]
|
|
||||||
`['product-doc' ~]
|
|
||||||
`['core-doc' ~]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-adoc-pdoc-cdoc-pre-pre-post])
|
|
||||||
::
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
:^ "arm-adoc-pdoc-cdoc-post-post-pre"
|
|
||||||
`['arm-doc' ~]
|
|
||||||
`['product-doc' ~]
|
|
||||||
`['core-doc' ~]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-adoc-pdoc-cdoc-post-post-pre])
|
|
||||||
::
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
:^ "arm-adoc-pdoc-cdoc-post-pre-post"
|
|
||||||
`['arm-doc' ~]
|
|
||||||
`['product-doc' ~]
|
|
||||||
`['core-doc' ~]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-adoc-pdoc-cdoc-post-pre-post])
|
|
||||||
::
|
|
||||||
%+ expect-eq
|
|
||||||
!> ^- arm-dox
|
|
||||||
:^ "arm-adoc-pdoc-cdoc-pre-post-post"
|
|
||||||
`['arm-doc' ~]
|
|
||||||
`['product-doc' ~]
|
|
||||||
`['core-doc' ~]
|
|
||||||
::
|
|
||||||
!> (get-arm-dox ~[%arm-adoc-pdoc-cdoc-pre-post-post])
|
|
||||||
==
|
|
||||||
::
|
::
|
||||||
|
+| %core-tests
|
||||||
++ test-core
|
++ test-core
|
||||||
%+ expect-eq
|
%+ expect-eq
|
||||||
!> ^- core-dox
|
!> ^- core-dox
|
||||||
|
Loading…
Reference in New Issue
Block a user