From 2f5a46681e56693b67b811dfbe69109d81ede4d8 Mon Sep 17 00:00:00 2001 From: "zik.saleeba" Date: Mon, 9 Mar 2009 20:48:26 +0000 Subject: [PATCH] Nesting test added git-svn-id: http://picoc.googlecode.com/svn/trunk@179 21eae674-98b7-11dd-bd71-f92a316d2d60 --- tests/16_nesting.c | 12 ++++++++++++ tests/16_nesting.expect | 18 ++++++++++++++++++ tests/Makefile | 3 ++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 tests/16_nesting.c create mode 100644 tests/16_nesting.expect diff --git a/tests/16_nesting.c b/tests/16_nesting.c new file mode 100644 index 0000000..c239aa3 --- /dev/null +++ b/tests/16_nesting.c @@ -0,0 +1,12 @@ +int x, y, z; + +for (x = 0; x < 2; x++) +{ + for (y = 0; y < 3; y++) + { + for (z = 0; z < 3; z++) + { + printf("%d %d %d\n", x, y, z); + } + } +} diff --git a/tests/16_nesting.expect b/tests/16_nesting.expect new file mode 100644 index 0000000..625ee13 --- /dev/null +++ b/tests/16_nesting.expect @@ -0,0 +1,18 @@ +0 0 0 +0 0 1 +0 0 2 +0 1 0 +0 1 1 +0 1 2 +0 2 0 +0 2 1 +0 2 2 +1 0 0 +1 0 1 +1 0 2 +1 1 0 +1 1 1 +1 1 2 +1 2 0 +1 2 1 +1 2 2 diff --git a/tests/Makefile b/tests/Makefile index 1c82a7d..16294ed 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -11,7 +11,8 @@ TESTS= 00_assignment.test \ 10_pointer.test \ 12_hashdefine.test \ 13_integer_literals.test \ - 14_if.test + 14_if.test \ + 16_nesting.test %.test: %.expect %.c @echo Test: $*...