Repository: groovy
Updated Branches:
  refs/heads/master 302debb89 -> bd42f3163


GROOVY-7291: test workaround until issue is resolved for Indy


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/bd42f316
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/bd42f316
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/bd42f316

Branch: refs/heads/master
Commit: bd42f316366b52bab0d7a32b9115fa56f30edc40
Parents: 302debb
Author: John Wagenleitner <jwagenleit...@apache.org>
Authored: Sun Oct 16 01:11:45 2016 -0700
Committer: John Wagenleitner <jwagenleit...@apache.org>
Committed: Sun Oct 16 01:13:35 2016 -0700

----------------------------------------------------------------------
 src/test/groovy/bugs/Groovy7291Bug.groovy | 54 +++++++++++++++++++-------
 1 file changed, 39 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/bd42f316/src/test/groovy/bugs/Groovy7291Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy7291Bug.groovy 
b/src/test/groovy/bugs/Groovy7291Bug.groovy
index afac56d..1e83f81 100644
--- a/src/test/groovy/bugs/Groovy7291Bug.groovy
+++ b/src/test/groovy/bugs/Groovy7291Bug.groovy
@@ -18,24 +18,48 @@
  */
 package groovy.bugs
 
-class Groovy7291Bug extends GroovyShellTestCase {
+import groovy.transform.NotYetImplemented
+
+class Groovy7291Bug extends GroovyTestCase {
+
+    static final boolean runningWithIndy = 
Boolean.getBoolean('groovy.target.indy')
+
+    @NotYetImplemented
+    void testPrimitiveDoubleIndy() {
+        if (!runningWithIndy) return
+        assertScript '''
+            double a
+            def b = {
+               a = a + 1
+            }
+            b()
+            assert a == 1.0d
+        '''
+    }
+
     void testPrimitiveDouble() {
-        evaluate('''
-double a;
-def b = {
-   a = a + 1;
-}
-b();
-        ''');
+        // TODO: remove this conditional and method above when fixed for Indy
+        if (runningWithIndy) return
+
+        assertScript '''
+            double a
+            def b = {
+               a = a + 1
+            }
+            b()
+            assert a == 1.0d
+        '''
     }
 
     void testDouble() {
-        shouldFail('''
-Double a;
-def b = {
-   a = a + 1;
-}
-b();
-        ''');
+        shouldFail(NullPointerException,
+        '''
+            Double a;
+            def b = {
+               a = a + 1;
+            }
+            b()
+        ''')
     }
+
 }

Reply via email to