From 5007870b52aa549971824959a55ad3bb886f09e0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 3 Sep 2018 16:37:32 +0200 Subject: Rename .test/test{} to .testscript/testscript{} --- unit-tests/test/script/parser/include.testscript | 104 +++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 unit-tests/test/script/parser/include.testscript (limited to 'unit-tests/test/script/parser/include.testscript') diff --git a/unit-tests/test/script/parser/include.testscript b/unit-tests/test/script/parser/include.testscript new file mode 100644 index 0000000..5e31f0d --- /dev/null +++ b/unit-tests/test/script/parser/include.testscript @@ -0,0 +1,104 @@ +# file : unit-tests/test/script/parser/include.testscript +# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +: none +: +$* <=foo.testscript; +$* <>EOO +.include foo.testscript +EOI +cmd +EOO + +: multiple +: +cat <"cmd foo" >=foo.testscript; +cat <"cmd bar" >=bar.testscript; +$* <>EOO +.include foo.testscript bar.testscript +EOI +cmd foo +cmd bar +EOO + +: once +: +cat <"cmd" >=foo.testscript; +$* <>EOO +.include foo.testscript +x +.include --once foo.testscript +.include --once bar/../foo.testscript +y +.include ../once/foo.testscript +EOI +cmd +x +y +cmd +EOO + +: group-id +: +cat <=foo.testscript; +{ + x = b +} +EOI +$* -s -i <>EOO +x = a +.include foo.testscript +EOI +{ + { # 2-foo-1 + } +} +EOO + +: test-id +: +cat <=foo.testscript; +cmd +EOI +$* -s -i <>EOO +x = a +.include foo.testscript +EOI +{ + { # 2-foo-1 + cmd + } +} +EOO + +: invalid-path +: +$* <>EOE != 0 +.include "" +EOI +testscript:1:2: error: invalid testscript include path '' +EOE + +: unable-open +: +$* <>~/EOE/ != 0 +.include foo.testscript +EOI +/testscript:1:2: error: unable to read testscript foo.testscript: .+/ +EOE -- cgit v1.1