From 63f02b9ad2562e91f838618cd6c11e834addbf7c Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Fri, 4 May 2012 13:13:32 +0200 Subject: [PATCH] Add tests for the for-statement. --- tests/for/for.1.js | 7 +++++++ tests/for/for.2.js | 8 ++++++++ tests/for/for.3.js | 8 ++++++++ 3 files changed, 23 insertions(+) create mode 100644 tests/for/for.1.js create mode 100644 tests/for/for.2.js create mode 100644 tests/for/for.3.js diff --git a/tests/for/for.1.js b/tests/for/for.1.js new file mode 100644 index 0000000..523938b --- /dev/null +++ b/tests/for/for.1.js @@ -0,0 +1,7 @@ + +var d = "" +var x = 0 +for (var i = 0; i < 20; i = i + 1) { + x = x + i + d = d + (i + ") x = " + x + "\n") +} diff --git a/tests/for/for.2.js b/tests/for/for.2.js new file mode 100644 index 0000000..0ef80e8 --- /dev/null +++ b/tests/for/for.2.js @@ -0,0 +1,8 @@ +var d = "" +var x = 0 +for (var i = 0; i < 20; i = i + 1) { + if (i % 2) + continue + x = x + i + d = d + (i + ") x = " + x + "\n") +} diff --git a/tests/for/for.3.js b/tests/for/for.3.js new file mode 100644 index 0000000..bdc641d --- /dev/null +++ b/tests/for/for.3.js @@ -0,0 +1,8 @@ +var d = "" +var x = 0 +for (var i = 0; i < 20; i = i + 1) { + if (i == 10) + break + x = x + i + d = d + (i + ") x = " + x + "\n") +} -- 2.7.4