#QUALITY by cg
authorClaus Gittinger <cg@exept.de>
Wed, 29 Aug 2018 13:16:52 +0200
changeset 2005 4c96619d8445
parent 2004 3b06c74f24b7
child 2006 60c218197fb0
#QUALITY by cg class: RegressionTests::JavaScriptTestClass added: #testForLoop1 #testForLoop2 #testForLoop3
RegressionTests__JavaScriptTestClass.st
--- a/RegressionTests__JavaScriptTestClass.st	Tue Aug 28 13:04:41 2018 +0200
+++ b/RegressionTests__JavaScriptTestClass.st	Wed Aug 29 13:16:52 2018 +0200
@@ -6,6 +6,47 @@
 /** category: testing **/
 
 /**
+    (new JavaScriptTestClass).testForLoop1()
+ **/
+function testForLoop1() {
+    var sum = 0;
+    
+    for (var i=0; i<10; i++) {
+        sum += i;
+    }
+    return sum;
+}
+
+/** category: testing **/
+
+/**
+    (new JavaScriptTestClass).testForLoop2()
+ **/
+function testForLoop2() {
+    for (; ; ) {
+        return 0;
+    }
+    return 1;
+}
+
+/** category: testing **/
+
+/**
+    (new JavaScriptTestClass).testForLoop3()
+ **/
+function testForLoop3() {
+    var i = 0;
+    
+    for (; ; ) {
+        if (i == 10) return 0;
+        i++;
+    }
+    return 1;
+}
+
+/** category: testing **/
+
+/**
     (new JavaScriptTestClass).testMap1()
  **/
 function testMap1() {