From e3b3b1a2d248efdc06f402e855abf86a83a6439c Mon Sep 17 00:00:00 2001 From: DrMaxNix Date: Thu, 1 Sep 2022 19:02:38 +0200 Subject: [PATCH] :white_check_mark: add some more tests --- test/comments.jce | 12 ++++++++++++ test/integer-prefixes.jce | 11 +++++++++++ test/strings.jce | 12 ++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 test/comments.jce create mode 100644 test/integer-prefixes.jce create mode 100644 test/strings.jce diff --git a/test/comments.jce b/test/comments.jce new file mode 100644 index 0000000..7b293e0 --- /dev/null +++ b/test/comments.jce @@ -0,0 +1,12 @@ +mov $1 42 # comment +mov $1 42 // comment +mov $1 42 ; comment + +# block comments +/* + Block comment +*/ + +/* Also a block comment */ + +mov /* Inline block comment */ $1 42 diff --git a/test/integer-prefixes.jce b/test/integer-prefixes.jce new file mode 100644 index 0000000..d1479fd --- /dev/null +++ b/test/integer-prefixes.jce @@ -0,0 +1,11 @@ +mov $dec 42 +echo $dec "\n" + +mov $hex 0x2A +echo $hex "\n" + +mov $oct 0o52 +echo $oct "\n" + +mov $bin 0b101010 +echo $bin "\n" diff --git a/test/strings.jce b/test/strings.jce new file mode 100644 index 0000000..42ef07c --- /dev/null +++ b/test/strings.jce @@ -0,0 +1,12 @@ +echo "Here comes a quote: \"Lorem ipsum\". This had to be escaped!\n" +echo "Here comes another quote: 'Lorem ipsum'. This didn't require escaping!\n" + +echo "multiple" "strings" "to" "echo" "\n" + +echo "Escape sequences work: \u2764\ufe0f" +echo 'Escape sequences are printed as-is: \u2764\ufe0f' + +echo "\t" "indent x1" +echo "\t\t" "indent x2" +echo "\t" "\t" "indent x2" +echo "indent x0"