You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by em...@apache.org on 2021/10/12 18:17:44 UTC

[groovy] branch master updated: GROOVY-9927: add test case

This is an automated email from the ASF dual-hosted git repository.

emilles 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 ed715e9  GROOVY-9927: add test case
ed715e9 is described below

commit ed715e9cf5699a9f29494e968e54ae07a40fbed9
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Tue Oct 12 13:17:34 2021 -0500

    GROOVY-9927: add test case
---
 .../groovy/tools/stubgenerator/Groovy10299.groovy  |  1 -
 .../{Groovy10299.groovy => Groovy9927.groovy}      | 29 ++++++++++++++--------
 2 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/src/test/org/codehaus/groovy/tools/stubgenerator/Groovy10299.groovy b/src/test/org/codehaus/groovy/tools/stubgenerator/Groovy10299.groovy
index 750c300..08026d2 100644
--- a/src/test/org/codehaus/groovy/tools/stubgenerator/Groovy10299.groovy
+++ b/src/test/org/codehaus/groovy/tools/stubgenerator/Groovy10299.groovy
@@ -40,7 +40,6 @@ final class Groovy10299 extends StringSourcesStubTestCase {
 
     @Override
     void verifyStubs() {
-        String name = this.class.name
         String stub = stubJavaSourceFor('Pogo')
         assert stub.contains('must_init = false;')
         assert !stub.contains('boolean -> boolean')
diff --git a/src/test/org/codehaus/groovy/tools/stubgenerator/Groovy10299.groovy b/src/test/org/codehaus/groovy/tools/stubgenerator/Groovy9927.groovy
similarity index 62%
copy from src/test/org/codehaus/groovy/tools/stubgenerator/Groovy10299.groovy
copy to src/test/org/codehaus/groovy/tools/stubgenerator/Groovy9927.groovy
index 750c300..eef6d6b 100644
--- a/src/test/org/codehaus/groovy/tools/stubgenerator/Groovy10299.groovy
+++ b/src/test/org/codehaus/groovy/tools/stubgenerator/Groovy9927.groovy
@@ -18,20 +18,32 @@
  */
 package org.codehaus.groovy.tools.stubgenerator
 
-final class Groovy10299 extends StringSourcesStubTestCase {
+final class Groovy9927 extends StringSourcesStubTestCase {
 
     @Override
     Map<String, String> provideSources() {
         [
-            'Pogo.groovy': '''
-                class Pogo {
-                    public final boolean must_init
+            'model/Outer.groovy': '''
+                package model
+                class Logger {
+                    enum Level {
+                        INFO, WARN, ERROR
+                    }
+                }
+            ''',
+            'other/Thing.groovy': '''
+                package other
+                import model.Logger
+                class Thing {
+                    String describe(Logger.Level level) {
+                        return level.name()
+                    }
                 }
             ''',
             'Main.java': '''
                 public class Main {
                     public static void main(String[] args) {
-                        new Pogo();
+                        new other.Thing();
                     }
                 }
             ''',
@@ -40,10 +52,7 @@ final class Groovy10299 extends StringSourcesStubTestCase {
 
     @Override
     void verifyStubs() {
-        String name = this.class.name
-        String stub = stubJavaSourceFor('Pogo')
-        assert stub.contains('must_init = false;')
-        assert !stub.contains('boolean -> boolean')
-        assert !stub.contains('new java.lang.Boolean')
+        String stub = stubJavaSourceFor('other.Thing')
+        assert stub.contains('java.lang.String describe(model.Logger.Level ')
     }
 }