groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [groovy] 02/02: fix test for JDK12
Date Sun, 31 Mar 2019 13:44:16 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 5c3159fac63de793ae8e2f2c17c022d747c6dac8
Author: Paul King <paulk@asert.com.au>
AuthorDate: Sun Mar 31 23:39:34 2019 +1000

    fix test for JDK12
---
 .../groovy/ast/tools/WideningCategoriesTest.groovy         | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/test/org/codehaus/groovy/ast/tools/WideningCategoriesTest.groovy b/src/test/org/codehaus/groovy/ast/tools/WideningCategoriesTest.groovy
index 28ba1de..63b72d6 100644
--- a/src/test/org/codehaus/groovy/ast/tools/WideningCategoriesTest.groovy
+++ b/src/test/org/codehaus/groovy/ast/tools/WideningCategoriesTest.groovy
@@ -91,7 +91,7 @@ class WideningCategoriesTest extends GenericsTestCase {
     void testBuildCommonTypeWithTwoClassesWithoutSuperClass() {
         ClassNode a = make(ClassA)
         ClassNode b = make(ClassB)
-        assert lowestUpperBound(a,b) == make(GroovyObject) // GroovyObject because Groovy
classes implicitely implement GroovyObject
+        assert lowestUpperBound(a,b) == make(GroovyObject) // GroovyObject because Groovy
classes implicitly implement GroovyObject
         assert lowestUpperBound(b,a) == make(GroovyObject)
     }
 
@@ -213,7 +213,7 @@ class WideningCategoriesTest extends GenericsTestCase {
         assert lub.genericsTypes.length == 1
         assert lub.genericsTypes[0].wildcard
         assert lub.genericsTypes[0].upperBounds[0].superClass == Number_TYPE
-        assert lub.genericsTypes[0].upperBounds[0].interfaces == [ make(Comparable) ]
+        assert make(Comparable) in lub.genericsTypes[0].upperBounds[0].interfaces
     }
 
     void testLUBWithTwoInterfacesAndSingleCommonInterface() {
@@ -242,7 +242,7 @@ class WideningCategoriesTest extends GenericsTestCase {
     void testLUBWithTwoArgumentTypesSharingOneInterfaceNotImplementedBySuperClass() {
         // BottomA extends Top implements Serializable
         // BottomB extends Top implements Serializable
-        // Top does not implement Serialiazable
+        // Top does not implement Serializable
         ClassNode a = extractTypesFromCode('List<org.codehaus.groovy.ast.tools.WideningCategoriesTest.BottomA>
type').type
         ClassNode b = extractTypesFromCode('List<org.codehaus.groovy.ast.tools.WideningCategoriesTest.BottomB>
type').type
         ClassNode lub = lowestUpperBound(a,b)
@@ -258,7 +258,7 @@ class WideningCategoriesTest extends GenericsTestCase {
     void testLUBWithTwoParameterizedTypesSharingOneInterfaceNotImplementedBySuperClass()
{
         // PTopInt extends PTop<Integer> implements Serializable
         // PTopLong extends PTop<Long> implements Serializable
-        // PTop<E> does not implement Serialiazable
+        // PTop<E> does not implement Serializable
         ClassNode a = extractTypesFromCode('org.codehaus.groovy.ast.tools.WideningCategoriesTest.PTopInt
type').type
         ClassNode b = extractTypesFromCode('org.codehaus.groovy.ast.tools.WideningCategoriesTest.PTopLong
type').type
         ClassNode lub = lowestUpperBound(a,b)
@@ -324,9 +324,9 @@ class WideningCategoriesTest extends GenericsTestCase {
         def type = superType.genericsTypes[0]
         assert type.wildcard
         assert type.upperBounds[0] instanceof LowestUpperBoundClassNode
-        assert type.upperBounds[0].interfaces as Set == [make(Serializable), make(Comparable)]
as Set
-
-
+        [Comparable, Serializable].each {
+            assert make(it) in type.upperBounds[0].interfaces
+        }
     }
 
     void testLUBOfArrayTypes() {


Mime
View raw message