groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [groovy] branch master updated: minor refactor: rename test
Date Sun, 05 May 2019 04:19:42 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


The following commit(s) were added to refs/heads/master by this push:
     new 320088a  minor refactor: rename test
320088a is described below

commit 320088a6493305a4a6b685f401d35c69dced4ac8
Author: Paul King <paulk@asert.com.au>
AuthorDate: Sun May 5 14:19:29 2019 +1000

    minor refactor: rename test
---
 .../{MyTestJunit5.groovy => JUnit5Test.groovy}     | 46 +++++++++++-----------
 1 file changed, 24 insertions(+), 22 deletions(-)

diff --git a/subprojects/groovy-test-junit5/src/test/groovy/MyTestJunit5.groovy b/subprojects/groovy-test-junit5/src/test/groovy/JUnit5Test.groovy
similarity index 57%
rename from subprojects/groovy-test-junit5/src/test/groovy/MyTestJunit5.groovy
rename to subprojects/groovy-test-junit5/src/test/groovy/JUnit5Test.groovy
index ad88257..3faa738 100644
--- a/subprojects/groovy-test-junit5/src/test/groovy/MyTestJunit5.groovy
+++ b/subprojects/groovy-test-junit5/src/test/groovy/JUnit5Test.groovy
@@ -24,31 +24,33 @@ import java.util.stream.Stream
 import static org.junit.jupiter.api.Assertions.assertTrue
 import static org.junit.jupiter.api.DynamicTest.dynamicTest
 
-class MyTestJUnit5 {
+class JUnit5Test {
 
-  @Test
-  void streamSum() {
-    assertTrue(Stream.of(1, 2, 3)
-      .mapToInt(i -> i)
-      .sum() > 5, () -> "Sum should be greater than 5")
-  }
+    @Test
+    void streamSum() {
+        assertTrue(Stream.of(1, 2, 3)
+                .mapToInt(i -> i)
+                .sum() > 5, () -> "Sum should be greater than 5")
+    }
 
-  @RepeatedTest(value=2, name = "{displayName} {currentRepetition}/{totalRepetitions}")
-  void streamSumRepeated() {
-    assert Stream.of(1, 2, 3).mapToInt(i -> i).sum() == 6
-  }
+    @RepeatedTest(value = 2, name = "{displayName} {currentRepetition}/{totalRepetitions}")
+    void streamSumRepeated() {
+        assert Stream.of(1, 2, 3).mapToInt(i -> i).sum() == 6
+    }
 
-  private boolean isPalindrome(s) { s == s.reverse()  }
+    private boolean isPalindrome(s) { s == s.reverse() }
 
-  @ParameterizedTest
-  @ValueSource(strings = [ "racecar", "radar", "able was I ere I saw elba" ])
-  void palindromes(String candidate) {
-    assert isPalindrome(candidate)
-  }
+    @ParameterizedTest
+    @ValueSource(strings = ["racecar", "radar", "able was I ere I saw elba"])
+    void palindromes(String candidate) {
+        assert isPalindrome(candidate)
+    }
 
-  @TestFactory
-  def dynamicTestCollection() {[
-    dynamicTest("Add test") { -> assert 1 + 1 == 2 },
-    dynamicTest("Multiply Test", () -> { assert 2 * 3 == 6 })
-  ]}
+    @TestFactory
+    def dynamicTestCollection() {
+        [
+                dynamicTest("Add test") { -> assert 1 + 1 == 2 },
+                dynamicTest("Multiply Test", () -> { assert 2 * 3 == 6 })
+        ]
+    }
 }


Mime
View raw message