You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2024/10/15 09:58:30 UTC
(shardingsphere) branch master updated: Add test cases on GroovyUtils (#33254)
This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new d60c69e8e44 Add test cases on GroovyUtils (#33254)
d60c69e8e44 is described below
commit d60c69e8e44e22cf2c75343839a232bc03621550
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Tue Oct 15 17:58:23 2024 +0800
Add test cases on GroovyUtils (#33254)
---
.../shardingsphere/infra/util/groovy/GroovyUtilsTest.java | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/groovy/GroovyUtilsTest.java b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/groovy/GroovyUtilsTest.java
index 9e5cfe1c55e..f4e241f1757 100644
--- a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/groovy/GroovyUtilsTest.java
+++ b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/groovy/GroovyUtilsTest.java
@@ -29,15 +29,13 @@ class GroovyUtilsTest {
@Test
void assertSplit() {
+ assertThat(GroovyUtils.split(""), is(Collections.emptyList()));
assertThat(GroovyUtils.split(" t_order_0, t_order_1 "), is(Arrays.asList("t_order_0", "t_order_1")));
assertThat(GroovyUtils.split("t_order_${null}"), is(Collections.singletonList("t_order_${null}")));
assertThat(GroovyUtils.split("t_order_${'xx'}"), is(Collections.singletonList("t_order_${'xx'}")));
- assertThat(GroovyUtils.split("t_order_${[0, 1, 2]},t_order_item_${[0, 2]}"),
- is(Arrays.asList("t_order_${[0, 1, 2]}", "t_order_item_${[0, 2]}")));
+ assertThat(GroovyUtils.split("t_order_${[0, 1, 2]},t_order_item_${[0, 2]}"), is(Arrays.asList("t_order_${[0, 1, 2]}", "t_order_item_${[0, 2]}")));
assertThat(GroovyUtils.split("t_order_${0..2},t_order_item_${0..1}"), is(Arrays.asList("t_order_${0..2}", "t_order_item_${0..1}")));
- assertThat(GroovyUtils.split("t_${[\"new${1+2}\",'old']}_order_${1..2}"),
- is(Collections.singletonList("t_${[\"new${1+2}\",'old']}_order_${1..2}")));
- assertThat(GroovyUtils.split("t_$->{[\"new$->{1+2}\",'old']}_order_$->{1..2}"),
- is(Collections.singletonList("t_$->{[\"new$->{1+2}\",'old']}_order_$->{1..2}")));
+ assertThat(GroovyUtils.split("t_${[\"new${1+2}\",'old']}_order_${1..2}"), is(Collections.singletonList("t_${[\"new${1+2}\",'old']}_order_${1..2}")));
+ assertThat(GroovyUtils.split("t_$->{[\"new$->{1+2}\",'old']}_order_$->{1..2}"), is(Collections.singletonList("t_$->{[\"new$->{1+2}\",'old']}_order_$->{1..2}")));
}
}