RegressionTests__JavaScriptTests.st
changeset 700 ea80598f6402
parent 652 042ff6eaa306
child 731 4ece34c0805e
--- a/RegressionTests__JavaScriptTests.st	Thu Oct 25 15:17:11 2012 +0200
+++ b/RegressionTests__JavaScriptTests.st	Fri Oct 26 12:32:49 2012 +0200
@@ -66,6 +66,23 @@
     ]
 !
 
+doTestEachFunctionFromSpec:spec 
+    spec do:[:tuple | 
+        |source expectError|
+
+        source := tuple first.
+        expectError := tuple second.
+
+        expectError ifTrue:[
+            self 
+                should:[ JavaScriptParser parseFunction:source ]
+                raise:Error
+        ] ifFalse:[
+            JavaScriptParser parseFunction:source.
+        ].
+    ]
+!
+
 execute:code for:receiver arguments:arguments
     |f result|
 
@@ -4661,6 +4678,29 @@
     "
 !
 
+test_30_parse_methods1
+    |spec|
+
+    "/ spec is { source shouldErrBoolean }
+    spec := #( 
+                ('
+execute(in1) {
+    var t;
+
+    Dialog.information((t = in1.value()) == nil ? "nil" : t);
+}'   
+false
+                )
+
+             ).
+    self doTestEachFunctionFromSpec:spec.
+
+    "
+     self run:#test_30_parse_methods1
+     self new test_30_parse_methods1
+    "
+!
+
 xtestNew04
     self 
         execute:'test() {