groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [groovy] branch master updated: Tweak test for Java-style array initialization
Date Wed, 15 Jan 2020 07:22:28 GMT
This is an automated email from the ASF dual-hosted git repository.

sunlan 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 1512bc7  Tweak test for Java-style array initialization
1512bc7 is described below

commit 1512bc73b4bc6cc0385a161e62e0a7d06f77df21
Author: Daniel Sun <sunlan@apache.org>
AuthorDate: Wed Jan 15 15:21:57 2020 +0800

    Tweak test for Java-style array initialization
---
 src/spec/test/DifferencesFromJavaTest.groovy | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/spec/test/DifferencesFromJavaTest.groovy b/src/spec/test/DifferencesFromJavaTest.groovy
index d3f935e..01f8c0f 100644
--- a/src/spec/test/DifferencesFromJavaTest.groovy
+++ b/src/spec/test/DifferencesFromJavaTest.groovy
@@ -48,13 +48,14 @@ assertEquals(1, result);
         shouldFail {
             assertScript '''
                 // tag::arraycreate_fail[]
-                int[] array = { 1, 2, 3}
+                int[] array = {1, 2, 3}
                 // end::arraycreate_fail[]
             '''
         }
         assertScript '''
             // tag::arraycreate_success[]
-            int[] array = [1,2,3]
+            int[] array = [1, 2, 3]
+            int[] array2 = new int[] {1, 2, 3} // Groovy 3.0.0 supports the Java-style array
initialization
             // end::arraycreate_success[]
         '''
     }


Mime
View raw message