groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [1/3] groovy git commit: Add DGM `startsWith(String...)` and `endsWith(String...)`
Date Sun, 31 Dec 2017 16:17:23 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X 6ea3da47e -> 1bd694e8c


Add DGM `startsWith(String...)` and `endsWith(String...)`

(cherry picked from commit ff220c6)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/f0eb637d
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/f0eb637d
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/f0eb637d

Branch: refs/heads/GROOVY_2_4_X
Commit: f0eb637dc7fcd9a73cac29140a5aae33e856ea9b
Parents: 6ea3da4
Author: sunlan <sunlan@apache.org>
Authored: Sun Dec 31 23:46:56 2017 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Mon Jan 1 00:10:25 2018 +0800

----------------------------------------------------------------------
 .../codehaus/groovy/runtime/StringGroovyMethodsTest.java  | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/f0eb637d/src/test/org/codehaus/groovy/runtime/StringGroovyMethodsTest.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/StringGroovyMethodsTest.java b/src/test/org/codehaus/groovy/runtime/StringGroovyMethodsTest.java
index c61f314..bd0812d 100644
--- a/src/test/org/codehaus/groovy/runtime/StringGroovyMethodsTest.java
+++ b/src/test/org/codehaus/groovy/runtime/StringGroovyMethodsTest.java
@@ -91,4 +91,14 @@ public class StringGroovyMethodsTest extends GroovyTestCase {
         assertTrue(StringGroovyMethods.isNumber(floatStr));
         assertFalse(StringGroovyMethods.isNumber(nonNumberStr));
     }
+
+    public void testStartsWith() {
+        assertTrue(StringGroovyMethods.startsWith("abcd", "ab", "ef"));
+        assertFalse(StringGroovyMethods.startsWith("abcd", "ef", "gh"));
+    }
+
+    public void testEndsWith() {
+        assertTrue(StringGroovyMethods.endsWith("abcd", "cd", "ef"));
+        assertFalse(StringGroovyMethods.endsWith("abcd", "ef", "gh"));
+    }
 }


Mime
View raw message