Fixed nested assignment bug

This commit is contained in:
2022-09-09 17:55:23 +01:00
parent f8747d8707
commit 4b99ce2fb6
7 changed files with 192 additions and 97 deletions

View File

@@ -61,4 +61,15 @@
assert week[first:second:third] == ["wednesday", "tuesday"], "indexing with variables failed";
}
//test nested indexing
{
var a = [[[0]]];
a[0][0][0] = 42;
assert a[0][0] == [42], "nested indexing failed";
}
print "All good";

View File

@@ -27,4 +27,17 @@
assert d[first] == 2, "indexing with variables failed";
}
//test nested indexing
{
var d = ["foo": ["bar": 0]];
d["foo"]["bar"] = 42;
print d;
assert d == ["foo": ["bar": 42]], "nested indexing failed";
}
print "All good";