summaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-05-24 22:21:40 +0300
committerGitHub <noreply@github.com>2018-05-24 22:21:40 +0300
commit41ab5166e42e1793419ba44e6fb060f7dbf7cd4c (patch)
tree6d5866ae11ed04e4ed147893f069bb49c6c232d6 /test cases
parent160da30732fb3f24f61028b8728830e27cf4ebea (diff)
parentfa04e5c8fb24632869cff316ae4765996821287a (diff)
downloadmeson-41ab5166e42e1793419ba44e6fb060f7dbf7cd4c.tar.gz
Merge pull request #3476 from filbranden/intbase1
Add support for octal and binary int literals
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/68 number arithmetic/meson.build12
-rw-r--r--test cases/failing/76 int literal leading zero/meson.build6
2 files changed, 18 insertions, 0 deletions
diff --git a/test cases/common/68 number arithmetic/meson.build b/test cases/common/68 number arithmetic/meson.build
index f2e84a8b2..e31d7e4e9 100644
--- a/test cases/common/68 number arithmetic/meson.build
+++ b/test cases/common/68 number arithmetic/meson.build
@@ -62,3 +62,15 @@ hex2_255 = 0XFF
assert(hex_255 == 255, 'Hex parsing is broken.')
assert(hex2_255 == 255, 'Uppercase hex parsing is broken.')
+
+bin_123 = 0b1111011
+bin2_123 = 0B1111011
+
+assert(bin_123 == 123, 'Bin number parsing is broken.')
+assert(bin2_123 == 123, 'Uppercase bin number parsing is broken.')
+
+oct_493 = 0o755
+oct2_493 = 0O755
+
+assert(oct_493 == 493, 'Oct number parsing is broken.')
+assert(oct2_493 == 493, 'Uppercase oct number parsing is broken.')
diff --git a/test cases/failing/76 int literal leading zero/meson.build b/test cases/failing/76 int literal leading zero/meson.build
new file mode 100644
index 000000000..7ad64ae09
--- /dev/null
+++ b/test cases/failing/76 int literal leading zero/meson.build
@@ -0,0 +1,6 @@
+
+# This should fail.
+# Decimal syntax is 123.
+# Octal syntax is 0o123.
+fail_0123 = 0123
+