Skip to content

Commit

Permalink
tools.scaffold: need a manifest for mason tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Aug 21, 2023
1 parent 5909881 commit bbf4ad8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
16 changes: 7 additions & 9 deletions basis/tools/scaffold/scaffold-tests.factor
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
! Copyright (C) 2009 Doug Coleman.
! See https://factorcode.org/license.txt for BSD license.

USING: help.markup io.streams.string kernel math sequences
tools.scaffold tools.scaffold.private tools.test unicode ;

IN: tools.scaffold.tests


Expand Down Expand Up @@ -51,20 +53,17 @@ IN: tools.scaffold.tests
[ [ \ test-maybe scaffold-word-docs ] with-string-writer ]
unit-test


{ "{ \"foofoo\" } [\n \"foo\" dup append\n] unit-test\n" } [
"\"foo\" dup append" [ read-unit-test ] with-string-reader
{ "{ \"foofoo\" } [\n USING: kernel sequences ; \"foo\" dup append\n] unit-test\n" } [
"USING: kernel sequences ; \"foo\" dup append" [ read-unit-test ] with-string-reader
] unit-test


{
"{\n \"foobarbazfoobarbazfoobarbazfoobarbazfoobarbazfoobarbazfoobarbazfoobarbaz\"\n} [\n \"foobarbaz\" 3 [ dup append ] times\n] unit-test\n"
"{\n \"foobarbazfoobarbazfoobarbazfoobarbazfoobarbazfoobarbazfoobarbazfoobarbaz\"\n} [\n USING: kernel math sequences ; \"foobarbaz\" 3 [ dup append ] times\n] unit-test\n"
} [
"\"foobarbaz\" 3 [ dup append ] times"
"USING: kernel math sequences ; \"foobarbaz\" 3 [ dup append ] times"
[ read-unit-test ] with-string-reader
] unit-test


{ "foobar [\n baz\n] unit-test\n" } [
"foobar" "baz" make-unit-test
] unit-test
Expand All @@ -74,7 +73,6 @@ unit-test
"foobar" "foz\nbaz" make-unit-test
] unit-test


{ { 2 } } [
"2 1 + 3 * 7 -" run-string
"USING: math ; 2 1 + 3 * 7 -" run-string
] unit-test
2 changes: 1 addition & 1 deletion basis/tools/scaffold/scaffold.factor
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ ${example-indent}}
" " glue ;

: run-string ( string -- datastack )
parse-string V{ } clone swap with-datastack ; inline
[ parse-string V{ } clone swap with-datastack ] with-file-vocabs ; inline

: read-unit-test ( -- str/f )
read-contents dup "" = [
Expand Down

0 comments on commit bbf4ad8

Please sign in to comment.