]> gitweb.factorcode.org Git - factor.git/blob - basis/io/unix/launcher/parser/parser-tests.factor
63aadcabbe778975f8583c4466566aa3280a1ef2
[factor.git] / basis / io / unix / launcher / parser / parser-tests.factor
1 IN: io.unix.launcher.parser.tests
2 USING: io.unix.launcher.parser tools.test ;
3
4 [ "" tokenize-command ] must-fail
5 [ "   " tokenize-command ] must-fail
6 [ V{ "a" } ] [ "a" tokenize-command ] unit-test
7 [ V{ "abc" } ] [ "abc" tokenize-command ] unit-test
8 [ V{ "abc" } ] [ "abc   " tokenize-command ] unit-test
9 [ V{ "abc" } ] [ "   abc" tokenize-command ] unit-test
10 [ V{ "abc" "def" } ] [ "abc def" tokenize-command ] unit-test
11 [ V{ "abc def" } ] [ "abc\\ def" tokenize-command ] unit-test
12 [ V{ "abc\\" "def" } ] [ "abc\\\\ def" tokenize-command ] unit-test
13 [ V{ "abc\\ def" } ] [ "'abc\\\\ def'" tokenize-command ] unit-test
14 [ V{ "abc\\ def" } ] [ "  'abc\\\\ def'" tokenize-command ] unit-test
15 [ V{ "abc\\ def" "hey" } ] [ "'abc\\\\ def' hey" tokenize-command ] unit-test
16 [ V{ "abc def" "hey" } ] [ "'abc def' \"hey\"" tokenize-command ] unit-test
17 [ "'abc def' \"hey" tokenize-command ] must-fail
18 [ "'abc def" tokenize-command ] must-fail
19 [ V{ "abc def" "h\"ey" } ] [ "'abc def' \"h\\\"ey\"  " tokenize-command ] unit-test
20
21 [
22     V{
23         "Hello world.app/Contents/MacOS/hello-ui"
24         "-i=boot.macosx-ppc.image"
25         "-include= math compiler ui"
26         "-deploy-vocab=hello-ui"
27         "-output-image=Hello world.app/Contents/Resources/hello-ui.image"
28         "-no-stack-traces"
29         "-no-user-init"
30     }
31 ] [
32     "\"Hello world.app/Contents/MacOS/hello-ui\" -i=boot.macosx-ppc.image \"-include= math compiler ui\" -deploy-vocab=hello-ui \"-output-image=Hello world.app/Contents/Resources/hello-ui.image\" -no-stack-traces -no-user-init" tokenize-command
33 ] unit-test