[groovy] branch master updated: GROOVY-9093: fix existing tests

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[groovy] branch master updated: GROOVY-9093: fix existing tests

paulk
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 4ec8168  GROOVY-9093: fix existing tests
4ec8168 is described below

commit 4ec8168cec3edffd7b7ced60dd64fcce42abdb81
Author: Paul King <[hidden email]>
AuthorDate: Sat Nov 21 15:11:46 2020 +1000

    GROOVY-9093: fix existing tests
---
 .../transform/packageScope/DifferentPackageTest.groovy     | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/test/org/codehaus/groovy/transform/packageScope/DifferentPackageTest.groovy b/src/test/org/codehaus/groovy/transform/packageScope/DifferentPackageTest.groovy
index 42888eb..80107da 100644
--- a/src/test/org/codehaus/groovy/transform/packageScope/DifferentPackageTest.groovy
+++ b/src/test/org/codehaus/groovy/transform/packageScope/DifferentPackageTest.groovy
@@ -18,7 +18,6 @@
  */
 package org.codehaus.groovy.transform.packageScope
 
-import groovy.test.NotYetImplemented
 import org.codehaus.groovy.control.*
 import org.codehaus.groovy.tools.GroovyClass
 import org.junit.Test
@@ -187,7 +186,7 @@ final class DifferentPackageTest {
         assert loader.loadClass('p.Peer').half() == 21
     }
 
-    @Test @NotYetImplemented // GROOVY-9093
+    @Test // GROOVY-9093
     void testDifferentPackageShouldNotSeeInstanceProps() {
         def err = shouldFail CompilationFailedException, {
             def loader = addSources(
@@ -202,14 +201,12 @@ final class DifferentPackageTest {
                         }
                     }
                 ''')
-            // TODO: Don't need this once compiler errors
-            assert loader.loadClass('q.Two').newInstance().valueSize() == 5
         }
 
-        assert err =~ / Access to ... value is forbidden /
+        assert err.message =~ /Access to q.Two#value is forbidden/
     }
 
-    @Test @NotYetImplemented // GROOVY-9093
+    @Test // GROOVY-9093
     void testDifferentPackageShouldNotSeeStaticProps1() {
         def err = shouldFail CompilationFailedException, {
             def loader = addSources(
@@ -224,10 +221,9 @@ final class DifferentPackageTest {
                         }
                     }
                 ''')
-            loader.loadClass('q.Two').half()
         }
 
-        assert err =~ / MissingPropertyException: No such property: CONST for class: q.Two /
+        assert err.message =~ /Access to q.Two#CONST is forbidden/
     }
 
     @Test
@@ -249,6 +245,6 @@ final class DifferentPackageTest {
                 ''')
         }
 
-        assert err =~ / Access to p.One#CONST is forbidden /
+        assert err.message =~ /Access to p.One#CONST is forbidden/
     }
 }