Moved tests from scripts/ to test/scripts/

This commit is contained in:
2022-11-11 14:51:47 +00:00
parent 0aa6e4063b
commit 2c143a8be5
36 changed files with 10 additions and 10 deletions

View File

@@ -0,0 +1,43 @@
//test basic insertion
{
var d = [:];
d["foo"] = "bar";
assert d == ["foo":"bar"], "basic insertion failed";
}
//test index arithmetic
{
var d = ["one":1, "two":2, "three":3];
d["three"] *= 3;
assert d == ["one":1, "two":2, "three":9], "index arithmetic failed";
}
//test indexing with variables
{
var d = ["one":1, "two":2, "three":3];
var first = "two";
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";