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/02/17 19:05:11 UTC

groovy git commit: Move tests using Java8 API

Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X cff728336 -> 15669d76c


Move tests using Java8 API


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

Branch: refs/heads/GROOVY_2_6_X
Commit: 15669d76c48f11fbee46ce2997a55398781d1f58
Parents: cff7283
Author: danielsun1106 <re...@hotmail.com>
Authored: Sun Feb 18 03:04:54 2018 +0800
Committer: danielsun1106 <re...@hotmail.com>
Committed: Sun Feb 18 03:04:54 2018 +0800

----------------------------------------------------------------------
 .../src/test/resources/core/MethodReference_01x.groovy         | 4 ----
 .../src/test/resources/core/MethodReference_01x_1_8.groovy     | 6 ++++++
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/15669d76/subprojects/parser-antlr4/src/test/resources/core/MethodReference_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/MethodReference_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/MethodReference_01x.groovy
index c25c0f3..81c3193 100644
--- a/subprojects/parser-antlr4/src/test/resources/core/MethodReference_01x.groovy
+++ b/subprojects/parser-antlr4/src/test/resources/core/MethodReference_01x.groovy
@@ -21,10 +21,6 @@ def mr = String::toUpperCase
 assert 'ABC' == mr('abc')
 assert 'ABC' == String::toUpperCase('abc')
 
-def m = ['apple', 'banana', 'orange'].stream().collect(Collectors.toMap(e -> e.charAt(0), e -> e, (e1, e2) -> e1, LinkedHashMap<String, String>::new))
-assert m instanceof LinkedHashMap
-assert ['a', 'b', 'o'] as TreeSet == m.keySet() as TreeSet
-assert ['apple', 'banana', 'orange'] as TreeSet == m.values() as TreeSet
 
 assert new HashMap<String, Integer>() == HashMap<String, Integer>::new()
 assert new HashSet<Integer>() == HashSet<Integer>::new()

http://git-wip-us.apache.org/repos/asf/groovy/blob/15669d76/subprojects/parser-antlr4/src/test/resources/core/MethodReference_01x_1_8.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/MethodReference_01x_1_8.groovy b/subprojects/parser-antlr4/src/test/resources/core/MethodReference_01x_1_8.groovy
index 9dbd6bd..6a57d64 100644
--- a/subprojects/parser-antlr4/src/test/resources/core/MethodReference_01x_1_8.groovy
+++ b/subprojects/parser-antlr4/src/test/resources/core/MethodReference_01x_1_8.groovy
@@ -74,5 +74,11 @@ assert ['Jochen', 'Paul', 'Daniel'] == [new Person('Jochen'), new Person('Paul')
 // class::instanceMethod
 assert 6 == Stream.of(1, 2, 3).reduce(0, BigDecimal::add)
 
+def m = ['apple', 'banana', 'orange'].stream().collect(Collectors.toMap(e -> e.charAt(0), e -> e, (e1, e2) -> e1, LinkedHashMap<String, String>::new))
+assert m instanceof LinkedHashMap
+assert ['a', 'b', 'o'] as TreeSet == m.keySet() as TreeSet
+assert ['apple', 'banana', 'orange'] as TreeSet == m.values() as TreeSet
+
+
 assert [new String[1], new String[2], new String[3]] == [1, 2, 3].stream().map(String[]::new).collect(Collectors.toList())
 assert [1, 2, 3] as String[] == [1, 2, 3].stream().map(String::valueOf).toArray(String[]::new)