You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by jw...@apache.org on 2016/10/16 08:12:42 UTC

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

Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X 96b0351de -> 269c0c8a0


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/269c0c8a
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/269c0c8a
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/269c0c8a

Branch: refs/heads/GROOVY_2_4_X
Commit: 269c0c8a0f71f2a265bbff438d2a212f5a21b85b
Parents: 96b0351
Author: John Wagenleitner <jw...@apache.org>
Authored: Sun Oct 16 01:11:45 2016 -0700
Committer: John Wagenleitner <jw...@apache.org>
Committed: Sun Oct 16 01:11:45 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/269c0c8a/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()
+        ''')
     }
+
 }