-
Code USING: kernel parser sequences quotations prettyprint fry ; QUALIFIED-WITH: tools.testest tt IN: testest.extras : wrap-it ( -- ) '[ tt:it#{ _ dip tt:}# ] ; : wrap-describe ( -- ) '[ tt:describe#{ _ dip tt:}# ] ; SYNTAX: it#{ \ tt:}# parse-until >quotation wrap-it suffix! \ call suffix! ; SYNTAX: describe#{ \ tt:}# parse-until >quotation wrap-describe suffix! \ call suffix! ;
Test Cases Failed USING: kernel tools.testest math prettyprint io ; QUALIFIED-WITH: testest.extras te IN: testest.tests : run-tests ( -- ) "Example" te:describe#{ "hello" te:it#{ <{ 1 1 + -> 2 }> }# "fail" te:it#{ <{ 1 1 + -> 3 }> }# "nested describe" te:describe#{ "pass" te:it#{ <{ 1 1 + -> 2 }> }# "fail" te:it#{ ! Nothing on the stack "Nothing on the stack!" print get-datastack . <{ 1 1 + -> 3 }> }# }# }# ; MAIN: run-tests
Output:
-
- All
- {{group.name}} ({{group.count}})
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}