You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2020/11/21 05:14:25 UTC
[groovy] branch master updated: GROOVY-9093: fix existing tests
(formatting)
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 3d3ec2e GROOVY-9093: fix existing tests (formatting)
3d3ec2e is described below
commit 3d3ec2e72d4232ccc6c614cad59bd58b7dcf0c15
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sat Nov 21 15:14:18 2020 +1000
GROOVY-9093: fix existing tests (formatting)
---
.../packageScope/DifferentPackageTest.groovy | 50 +++++++++++-----------
1 file changed, 26 insertions(+), 24 deletions(-)
diff --git a/src/test/org/codehaus/groovy/transform/packageScope/DifferentPackageTest.groovy b/src/test/org/codehaus/groovy/transform/packageScope/DifferentPackageTest.groovy
index 80107da..4030f62 100644
--- a/src/test/org/codehaus/groovy/transform/packageScope/DifferentPackageTest.groovy
+++ b/src/test/org/codehaus/groovy/transform/packageScope/DifferentPackageTest.groovy
@@ -186,41 +186,43 @@ final class DifferentPackageTest {
assert loader.loadClass('p.Peer').half() == 21
}
- @Test // GROOVY-9093
+ @Test
+ // GROOVY-9093
void testDifferentPackageShouldNotSeeInstanceProps() {
def err = shouldFail CompilationFailedException, {
- def loader = addSources(
- One: P_DOT_ONE,
- Two: '''
- package q
-
- @groovy.transform.CompileStatic
- class Two extends p.One {
- int valueSize() {
- value.size() // not visible
+ addSources(
+ One: P_DOT_ONE,
+ Two: '''
+ package q
+
+ @groovy.transform.CompileStatic
+ class Two extends p.One {
+ int valueSize() {
+ value.size() // not visible
+ }
}
- }
- ''')
+ ''')
}
assert err.message =~ /Access to q.Two#value is forbidden/
}
- @Test // GROOVY-9093
+ @Test
+ // GROOVY-9093
void testDifferentPackageShouldNotSeeStaticProps1() {
def err = shouldFail CompilationFailedException, {
- def loader = addSources(
- One: P_DOT_ONE,
- Two: '''
- package q
-
- @groovy.transform.CompileStatic
- class Two extends p.One {
- static def half() {
- (CONST / 2) // not visible
+ addSources(
+ One: P_DOT_ONE,
+ Two: '''
+ package q
+
+ @groovy.transform.CompileStatic
+ class Two extends p.One {
+ static def half() {
+ (CONST / 2) // not visible
+ }
}
- }
- ''')
+ ''')
}
assert err.message =~ /Access to q.Two#CONST is forbidden/