groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [groovy] 03/04: fix unintended illegal access
Date Thu, 18 Apr 2019 12:06:46 GMT
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

commit fb5b6a03a04edccdc637132192cb5c0912639e35
Author: Paul King <paulk@asert.com.au>
AuthorDate: Thu Apr 18 21:25:58 2019 +1000

    fix unintended illegal access
---
 .../inspect/swingui/ScriptToTreeNodeAdapterTest.groovy     | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapterTest.groovy
b/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapterTest.groovy
index 29dff39..2e64fea 100644
--- a/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapterTest.groovy
+++ b/subprojects/groovy-console/src/test/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapterTest.groovy
@@ -84,9 +84,10 @@ class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
      */
     private assertMapEntry(mapEntry, expectedKey, expectedValue) {
         assertNotNull('Could not locate 1st MapEntryExpression in AST', mapEntry)
-        assertEquals('Wrong # map entries', 2, mapEntry.children.size())
-        assertEquals('Wrong key', expectedKey, mapEntry.children[0].toString())
-        assertEquals('Wrong value', expectedValue, mapEntry.children[1].toString())
+        def children = mapEntry.children().toList()
+        assertEquals('Wrong # map entries', 2, children.size())
+        assertEquals('Wrong key', expectedKey, children[0].toString())
+        assertEquals('Wrong value', expectedValue, children[1].toString())
     }
 
     /**
@@ -222,10 +223,11 @@ class ScriptToTreeNodeAdapterTest extends GroovyTestCase {
         }
         assertNotNull('Could not locate NamedArgumentListExpression in AST', namedArgList)
 
-        assertEquals('Wrong # named arguments', 2, namedArgList.children.size())
+        def children = namedArgList.children().toList()
+        assertEquals('Wrong # named arguments', 2, children.size())
 
-        assertMapEntry(namedArgList.children[0], 'Constant - foo : java.lang.String', 'Constant
- bar : java.lang.String')
-        assertMapEntry(namedArgList.children[1], 'Constant - baz : java.lang.String', 'Constant
- qux : java.lang.String')
+        assertMapEntry(children[0], 'Constant - foo : java.lang.String', 'Constant - bar
: java.lang.String')
+        assertMapEntry(children[1], 'Constant - baz : java.lang.String', 'Constant - qux
: java.lang.String')
     }
 
     void testDynamicVariable() {


Mime
View raw message