# 1) isolation of array copies in direct update

a = mkarray(1, 2, 3);
b = a;
b[1] = 5;

if (a[1] != 2 || b[1] != 5) exit(1);


# 2) isolation of array copies in indirect update

a = mkarray(1, 2, 3);
b = a;
b[1]++;

if (a[1] != 2 || b[1] != 3) exit(2);


# 3) isolation of struct copies in direct update

a = mkstruct("foo", 42, "bar", 100);
b = a;
b.foo = 10;

if (a.foo != 42 || b.foo != 10) exit(3);


# 4) isolation of struct copies in indirect update

a = mkstruct("foo", 42, "bar", 100);
b = a;
b.bar++;

if (a.bar != 100 || b.bar != 101) exit(4);


# 5) isolation of variable copies in direct update

a = 12;
b = a;
b = 5;

if (a != 12 || b != 5) exit(5);


# 6) isolation of variable copies in indirect update

a = 12;
b = a;
b++;

if (a != 12 || b != 13) exit(6);


print("6 subtests ");