diff options
Diffstat (limited to 'Build/source/utils/asymptote/tests/array/fields.asy')
-rw-r--r-- | Build/source/utils/asymptote/tests/array/fields.asy | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/tests/array/fields.asy b/Build/source/utils/asymptote/tests/array/fields.asy index 8435551aceb..7845ef2de64 100644 --- a/Build/source/utils/asymptote/tests/array/fields.asy +++ b/Build/source/utils/asymptote/tests/array/fields.asy @@ -76,4 +76,26 @@ StartTest("fields"); // TODO: Test inserting/deleting lengths more seriously. } +{ + // Test extended for. + int[] a = {1,4,6,2,7,4,8,9,1,3,-1}; + int i = 0; + for (int x : a) { + assert(x == a[i]); + ++i; + } + assert(i == a.length); +} + +{ + // Test extended for. + int[] a = {1,4,6,2,7,4,8,9,1,3,-1}; + int i = 0; + for (var x : a) { + assert(x == a[i]); + ++i; + } + assert(i == a.length); +} + EndTest(); |