diff options
Diffstat (limited to 'Build/source/utils/asymptote/tests/types/shadow.asy')
-rw-r--r-- | Build/source/utils/asymptote/tests/types/shadow.asy | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/tests/types/shadow.asy b/Build/source/utils/asymptote/tests/types/shadow.asy new file mode 100644 index 00000000000..09d73abc020 --- /dev/null +++ b/Build/source/utils/asymptote/tests/types/shadow.asy @@ -0,0 +1,17 @@ +import TestLib; +StartTest("shadow"); +int x = 1; +int getX() { return x; } +void setX(int value) { x=value; } + +// Shadow x with another int, but x should still be in memory. +int x = 2; +assert(x==2); +assert(getX()==1); +x = 4; +assert(x==4); +assert(getX()==1); +setX(7); +assert(x==4); +assert(getX()==7); +EndTest(); |