From 93f25fb15faf7dce6d59954665dcb6d594255b12 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 7 Sep 2020 00:16:44 +0200 Subject: tests: introduce testcases Signed-off-by: Jo-Philipp Wich --- tests/00_syntax/09_string_literals | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/00_syntax/09_string_literals (limited to 'tests/00_syntax/09_string_literals') diff --git a/tests/00_syntax/09_string_literals b/tests/00_syntax/09_string_literals new file mode 100644 index 0000000..cd84d3e --- /dev/null +++ b/tests/00_syntax/09_string_literals @@ -0,0 +1,25 @@ +String literals may be enclosed in single or double quotes. +Embedded escape sequences are started with a backslash, followed +by either a hexadecimal, an octal or a single character escape sequence. + +-- Expect stdout -- +Single quoted string +Double quoted string +Unicode escape sequence: ☀💩 +Escaped double quote (") character +Escaped single quote (') character +Hexadecimal escape: XYZ xyz +Octal escape: ABC xyz +{ "Single char escape": "\u0007\b\u001b\f\r\t\u000b\\\n" } +-- End -- + +-- Testcase -- +{{ 'Single quoted string' }} +{{ "Double quoted string" }} +{{ "Unicode escape sequence: \u2600\uD83D\uDCA9" }} +{{ "Escaped double quote (\") character" }} +{{ 'Escaped single quote (\') character' }} +{{ "Hexadecimal escape: \x58\x59\x5A \x78\x79\x7a" }} +{{ "Octal escape: \101\102\103 \170\171\172" }} +{{ { "Single char escape": "\a\b\e\f\r\t\v\\\n" } }} +-- End -- -- cgit v1.2.3