Multiline unit test and bug fix

release
Daniel Ehrenberg 2007-12-11 01:54:16 -05:00
parent fd63917d8b
commit e1346ced8b
3 changed files with 11 additions and 2 deletions

View File

@ -2,7 +2,7 @@ USING: help.markup help.syntax multiline ;
HELP: STRING:
{ $syntax "STRING: name\nfoo\n;" }
{ $description "Forms a multiline string literal, or 'here document' stored in the word called name. A semicolon is used to signify the end, and that semicolon must be on a line by itself, not preceeded or followed by any whitespace. The string will have newlines in between lines and at the end." } ;
{ $description "Forms a multiline string literal, or 'here document' stored in the word called name. A semicolon is used to signify the end, and that semicolon must be on a line by itself, not preceeded or followed by any whitespace. The string will have newlines in between lines but not at the end, unless there is a blank line before the semicolon." } ;
IN: multiline
ABOUT: POSTPONE: STRING:

View File

@ -0,0 +1,9 @@
USING: multiline tools.test ;
STRING: test-it
foo
bar
;
[ "foo\nbar\n" ] [ test-it ] unit-test

View File

@ -11,7 +11,7 @@ IN: multiline
[ drop lexer get next-line ] [ % "\n" % (parse-here) ] if ;
: parse-here ( -- str )
[ (parse-here) ] "" make
[ (parse-here) ] "" make 1 head*
lexer get next-line ;
: STRING: