You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2018/06/29 19:18:25 UTC
groovy git commit: Fix the
`testExplicitStaticMethodCallHasPrecedenceOverStaticImport`
Repository: groovy
Updated Branches:
refs/heads/master a3c245f30 -> 6993b35b1
Fix the `testExplicitStaticMethodCallHasPrecedenceOverStaticImport`
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/6993b35b
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/6993b35b
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/6993b35b
Branch: refs/heads/master
Commit: 6993b35b1f6f431d2b6ac5e4091bd364355392b2
Parents: a3c245f
Author: danielsun1106 <re...@hotmail.com>
Authored: Sat Jun 30 03:18:49 2018 +0800
Committer: danielsun1106 <re...@hotmail.com>
Committed: Sat Jun 30 03:18:49 2018 +0800
----------------------------------------------------------------------
src/test/groovy/StaticImportTest.groovy | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/groovy/blob/6993b35b/src/test/groovy/StaticImportTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/StaticImportTest.groovy b/src/test/groovy/StaticImportTest.groovy
index fff9e31..5f12f0b 100644
--- a/src/test/groovy/StaticImportTest.groovy
+++ b/src/test/groovy/StaticImportTest.groovy
@@ -372,9 +372,19 @@ class Foo4964 {
import static Foo4964.*
class Bar4964 {
static doIt() { [k: 'bar'] }
+
+ /*
+ The following `run` method is invoked by `testExplicitStaticMethodCallHasPrecedenceOverStaticImport`
+ As the method name shows, "ExplicitStaticMethodCall Has Precedence Over StaticImport", but the original test code does not conform to the intention
+ */
static run() {
- assert doIt().k == 'foo'
- assert doIt() == [k: 'foo']
+// The original test code is commented as follows:
+// assert doIt().k == 'foo'
+// assert doIt() == [k: 'foo']
+
+ assert doIt().k == 'bar'
+ assert doIt() == [k: 'bar']
+
assert Bar4964.doIt() == [k: 'bar']
assert Bar4964.doIt().k == 'bar'
}