From d52c1fb406b1cef82c5f5a28fc1804d7d99a49d8 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 17 Nov 2016 01:35:29 +0300 Subject: Add support for build2 for tests and examples --- unit-tests/lexer/testscript | 192 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100644 unit-tests/lexer/testscript (limited to 'unit-tests/lexer/testscript') diff --git a/unit-tests/lexer/testscript b/unit-tests/lexer/testscript new file mode 100644 index 0000000..fb4f862 --- /dev/null +++ b/unit-tests/lexer/testscript @@ -0,0 +1,192 @@ +# file : unit-tests/lexer/testscript +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +# @@ Give tests some meaningfull descriptions. +# + +: 000 +: +cat <>>test.cli; +help +help-me +-h +--help +--help-me +--help-me- +/h +/help-me +/help/me +--_ + +EOI +$* test.cli >>EOO +identifier: help +identifier: help-me +identifier: -h +identifier: --help +identifier: --help-me +identifier: --help-me- +identifier: /h +identifier: /help-me +identifier: /help +identifier: /me +identifier: --_ + +EOO + +: 001 +: +cat <>>test.cli; +5 +123456 +-12345 +- 1 +- +123 +EOI +$* test.cli >>EOO +5 +123456 +-12345 +-1 +-123 + +EOO + +: 002 +: +cat <>>test.cli; +'a' +'\\n' +'\\\\' +'\\0' +'\\'' +'\\xaf' +'\\111' +EOI +$* test.cli >>EOO +'a' +'\\n' +'\\\\' +'\\0' +'\\'' +'\\xaf' +'\\111' + +EOO + +: 003 +: +cat <>>test.cli; +"abc"; +"a\\nb"; +"abc\\\\"; +"aaa\\0"; +"\\""; +"a\\xaf"; +"a\\111"; +"abc""def"; +"abc" "def"; +"abc + def + + xyz"; +EOI +$* test.cli >>EOO +"abc" +; +"a\\nb" +; +"abc\\\\" +; +"aaa\\0" +; +"\\"" +; +"a\\xaf" +; +"a\\111" +; +"abc""def" +; +"abc""def" +; +"abc + def + + xyz" +; + +EOO + +: 004 +: +cat <>>test.cli; +include "foo/abc.hxx"; +include ; +include "c++:map"; +include ; +include "map.cli" +EOI +$* test.cli >>EOO +keyword: include +c++ path: "foo/abc.hxx" +; +keyword: include +c++ path: +; +keyword: include +c++ path: "map" +; +keyword: include +cli path: +; +keyword: include +cli path: "map.cli" + +EOO + +: 005 +: +cat <>>test.cli; +\(abc, 123 - 345, 12.34) + +EOI +$* test.cli >>EOO +\(abc, 123 - 345, 12.34) + + +EOO + +: 006 +: +cat <>>test.cli; +// c++ comment ; +/* c comment ; */ +; +"a" // foo +"b" +"a" /* foo +bar +baz */ "b"; +- // aaa +5; +- /* a +a +a*/ 5 +// eos +: +:: +EOI +$* test.cli >>EOO +; +"a""b""a""b" +; +-5 +; +-5 +: +:: + +EOO -- cgit v1.1