summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOri Bernstein <ori@markovcorp.com>2017-02-14 11:19:44 -0800
committerOri Bernstein <ori@markovcorp.com>2017-02-14 11:19:44 -0800
commit9d11b6dbcecb0ed2013043bbff1dea9ac0355c7b (patch)
tree39d27e69ce5898ec0994bf47dc39314f855f14fc /test
parentc819f3a197d66c0f7c7c49aaffdf045bd4a46123 (diff)
downloadmc-9d11b6dbcecb0ed2013043bbff1dea9ac0355c7b.tar.gz
Add test for array alignment bug.
Diffstat (limited to 'test')
-rw-r--r--test/arraypack.myr15
-rw-r--r--test/compoundimpl.myr2
-rw-r--r--test/tests1
3 files changed, 17 insertions, 1 deletions
diff --git a/test/arraypack.myr b/test/arraypack.myr
new file mode 100644
index 0000000..51aa1bd
--- /dev/null
+++ b/test/arraypack.myr
@@ -0,0 +1,15 @@
+use std
+
+/* test for accidentally packed values */
+const a = [
+ (1, "foo"),
+ (2, "bar"),
+ (3, "baz"),
+]
+
+const main = {
+ for x in a[:]
+ std.put("{}", x)
+ ;;
+ std.put("\n")
+}
diff --git a/test/compoundimpl.myr b/test/compoundimpl.myr
index 4c946e2..72898fa 100644
--- a/test/compoundimpl.myr
+++ b/test/compoundimpl.myr
@@ -21,7 +21,7 @@ generic foo = {x : @a::frobable
}
const main = {
- var a = 123
+ var a = (123 : int)
var b = 'c'
foo(&a)
foo(&b)
diff --git a/test/tests b/test/tests
index 2b509bb..b19f482 100644
--- a/test/tests
+++ b/test/tests
@@ -121,6 +121,7 @@ B matchptr P 'worked'
F matchmixed
B bigliteral P 34359738368
B arraylit-ni E 2
+B arraypack P '(1, foo)(2, bar)(3, baz)'
B arraypass P 1
B livearraylit E 21
# B arraylit E 3 ## BUGGERED