aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/char_literals.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/char_literals.sh')
-rw-r--r--tests/char_literals.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/char_literals.sh b/tests/char_literals.sh
new file mode 100644
index 0000000..c883eba
--- /dev/null
+++ b/tests/char_literals.sh
@@ -0,0 +1,25 @@
+test_exit_code 0 <<'EOF'
+#include "../../helpers.h"
+
+int main() {
+ ASSERT_EQ(97, 'a');
+ ASSERT_EQ(48, '0');
+ ASSERT_EQ(92, '\\');
+ ASSERT_EQ(39, '\'');
+ ASSERT_EQ(10, '\n');
+
+ ASSERT_EQ(39, '\'');
+ ASSERT_EQ(34, '\"');
+ ASSERT_EQ(63, '\?');
+ ASSERT_EQ(92, '\\');
+ ASSERT_EQ(7, '\a');
+ ASSERT_EQ(8, '\b');
+ ASSERT_EQ(12, '\f');
+ ASSERT_EQ(10, '\n');
+ ASSERT_EQ(13, '\r');
+ ASSERT_EQ(9, '\t');
+ ASSERT_EQ(11, '\v');
+
+ ASSERT_EQ(0, '\0');
+}
+EOF