diff options
author | Karl Berry <karl@freefriends.org> | 2011-05-28 02:18:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-05-28 02:18:52 +0000 |
commit | c59fe5fe4739f0c61560f05d4e42b4e552219b27 (patch) | |
tree | 8cf79e85e394b3177a28d374415840a4e0a025ad /Build/source/utils/asymptote/tests/frames | |
parent | 771db15706dbf3f4af8b630dcb15646a3e5fda00 (diff) |
asy 2.10
git-svn-id: svn://tug.org/texlive/trunk@22633 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/tests/frames')
-rw-r--r-- | Build/source/utils/asymptote/tests/frames/loop.asy | 167 |
1 files changed, 167 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/tests/frames/loop.asy b/Build/source/utils/asymptote/tests/frames/loop.asy index ceb65a1ff56..a4714d1f8da 100644 --- a/Build/source/utils/asymptote/tests/frames/loop.asy +++ b/Build/source/utils/asymptote/tests/frames/loop.asy @@ -26,4 +26,171 @@ for (int i=0; i<10; ++i) { } assert(f()==70); +{ + int y = 3; + int z = 0; + for (int i = 0; i < 7; ++i) + { + ++z; + continue; + y = 4; + } + assert(y == 3); + assert(z == 7); +} +{ + int y = 3; + int z = 0; + for (int i = 0; i < 7; ++i) + { + ++z; + break; + y = 4; + } + assert(y == 3); + assert(z == 1); +} +{ + int y = 3; + int z = 0; + for (int i = 0; i < 7; ++i) + { + void g() {} + ++z; + continue; + y = 4; + } + assert(y == 3); + assert(z == 7); +} +{ + int y = 3; + int z = 0; + for (int i = 0; i < 7; ++i) + { + void g() {} + ++z; + break; + y = 4; + } + assert(y == 3); + assert(z == 1); +} + +// While loops +{ + int y = 7; + int z = 0; + while (z < 10) { + ++z; + continue; + ++y; + } + assert(z == 10); + assert(y == 7); +} + +{ + int y = 7; + int z = 0; + while (z < 10) { + void g() {} + ++z; + continue; + ++y; + } + assert(z == 10); + assert(y == 7); +} + +{ + int y = 7; + int z = 0; + while (z < 10) { + ++z; + break; + ++y; + } + assert(z == 1); + assert(y == 7); +} + +{ + int y = 7; + int z = 0; + while (z < 10) { + void g() {} + ++z; + break; + ++y; + } + assert(z == 1); + assert(y == 7); +} + + +{ + int y = 7; + int z = 0; + while (z < 10) { + ++z; + continue; + ++y; + } + assert(z == 10); + assert(y == 7); +} + +// Do loops +{ + int y = 7; + int z = 0; + do { + void g() {} + ++z; + continue; + ++y; + } while (z < 10); + assert(z == 10); + assert(y == 7); +} + +{ + int y = 7; + int z = 0; + do { + ++z; + break; + ++y; + } while (z < 10); + assert(z == 1); + assert(y == 7); +} + +{ + int y = 7; + int z = 0; + do { + void g() {} + ++z; + break; + ++y; + } while (z < 10); + assert(z == 1); + assert(y == 7); +} + +{ + int x = 456; + do { x = 123; } while (false); + assert(x == 123); +} + +{ + int x = 456; + do { void g() {} x = 123; } while (false); + assert(x == 123); +} + + EndTest(); |