]> gitweb.factorcode.org Git - factor.git/blob - basis/multiline/multiline-tests.factor
multiline: adding (( )) comments.
[factor.git] / basis / multiline / multiline-tests.factor
1 USING: accessors eval lexer multiline sequences tools.test ;
2 IN: multiline.tests
3
4 STRING: test-it
5 foo
6 bar
7
8 ;
9
10 { "foo\nbar\n" } [ test-it ] unit-test
11
12 /*
13 <<
14 SYNTAX: MULTILINE-LITERAL: parse-here suffix! ;
15 >>
16
17 { { "bar" } }
18 [
19     CONSTANT: foo { MULTILINE-LITERAL:
20 bar
21 ;
22 } foo
23 ] unit-test
24
25 ! Make sure parse-here fails if extra crap appears on the first line
26 [
27     "CONSTANT: foo { MULTILINE-LITERAL: asdfasfdasdfas
28 bar
29 ;
30 }" eval
31 ] must-fail
32 */
33
34 { "abc" } [ "USE: multiline [=[ abc]=]" eval( -- string ) ] unit-test
35 [ "USE: multiline [=[" eval( -- string ) ] [ error>> unexpected? ] must-fail-with
36 [ "USE: multiline [=[ abc" eval( -- string ) ] [ error>> unexpected? ] must-fail-with
37 [ "USE: multiline [=[ abc\n\n" eval( -- string ) ] [ error>> unexpected? ] must-fail-with
38 [ "USE: multiline [=[ hello]=]length" eval( -- string ) ] [ error>> unexpected? ] must-fail-with