2009-09-20 15:18:19 -04:00
|
|
|
USING: accessors eval strings.parser strings.parser.private
|
|
|
|
tools.test ;
|
2009-09-19 04:55:05 -04:00
|
|
|
IN: strings.parser.tests
|
2008-12-08 20:46:40 -05:00
|
|
|
|
|
|
|
[ "Hello\n\rworld" ] [ "Hello\\n\\rworld" unescape-string ] unit-test
|
2009-09-19 04:55:05 -04:00
|
|
|
|
|
|
|
[ "Hello\n\rworld" ] [ "Hello\n\rworld" ] unit-test
|
|
|
|
[ "Hello\n\rworld" ] [ """Hello\n\rworld""" ] unit-test
|
|
|
|
[ "Hello\n\rworld\n" ] [ "Hello\n\rworld
|
|
|
|
" ] unit-test
|
|
|
|
[ "Hello\n\rworld" "hi" ] [ "Hello\n\rworld" "hi" ] unit-test
|
|
|
|
[ "Hello\n\rworld" "hi" ] [ """Hello\n\rworld""" """hi""" ] unit-test
|
|
|
|
[ "Hello\n\rworld\n" "hi" ] [ """Hello\n\rworld
|
|
|
|
""" """hi""" ] unit-test
|
|
|
|
[ "Hello\n\rworld\"" "hi" ] [ """Hello\n\rworld\"""" """hi""" ] unit-test
|
2009-09-20 15:18:19 -04:00
|
|
|
|
|
|
|
[
|
|
|
|
"\"\"\"Hello\n\rworld\\\n\"\"\"" eval( -- obj )
|
|
|
|
] [
|
|
|
|
error>> escaped-char-expected?
|
|
|
|
] must-fail-with
|