diff options
Diffstat (limited to 'unit-tests/test/script/parser')
-rw-r--r-- | unit-tests/test/script/parser/buildfile | 4 | ||||
-rw-r--r-- | unit-tests/test/script/parser/cleanup.test | 35 |
2 files changed, 37 insertions, 2 deletions
diff --git a/unit-tests/test/script/parser/buildfile b/unit-tests/test/script/parser/buildfile index b053971..e64159e 100644 --- a/unit-tests/test/script/parser/buildfile +++ b/unit-tests/test/script/parser/buildfile @@ -11,7 +11,7 @@ filesystem config/{utility init operation} dump types-parsers \ test/{target script/{token lexer parser script}} exe{driver}: cxx{driver} ../../../../build2/cxx{$src} $libs \ -test{pre-parse expansion redirect here-document command-re-parse scope \ - setup-teardown} +test{cleanup command-re-parse expansion here-document pre-parse redirect \ + scope setup-teardown} include ../../../../build2/ diff --git a/unit-tests/test/script/parser/cleanup.test b/unit-tests/test/script/parser/cleanup.test new file mode 100644 index 0000000..7fe746d --- /dev/null +++ b/unit-tests/test/script/parser/cleanup.test @@ -0,0 +1,35 @@ +$* <<EOI >>EOO # file-dir +cmd &file &dir/ +EOI +cmd &file &dir/ +EOO + +$* <<EOI >>EOO # quote-file-dir +cmd &"f ile" &"d ir/" +EOI +cmd &"f ile" &"d ir/" +EOO + +$* <<EOI >>EOO # dup-file +cmd &file &file +EOI +cmd &file &file +EOO + +$* <<EOI 2>>EOE != 0 # file-fail1 +cmd & >file +EOI +testscript:1:7: error: missing cleanup path +EOE + +$* <<EOI 2>>EOE != 0 # file-fail2 +cmd & +EOI +testscript:1:6: error: missing cleanup path +EOE + +$* <<EOI 2>>EOE != 0 # file-fail3 +cmd &"" +EOI +testscript:1:6: error: empty cleanup path +EOE |