Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ParameterizedTest @MethodSource("testSplitArguments")
- void testSplit(String input, String separator, String... expected) {
- assertArrayEquals(expected, input.split(separator));
- }
- static Stream<Arguments> testSplitArguments() {
- return Stream.of(arguments("a/b/c", "/", new String[] {"a", "b", "c"}),
- arguments("abc", "/", new String[] {"abc"}),
- arguments("a/b/c/", "/", new String[] {"a", "b", "c"})
- );}
Advertisement
Add Comment
Please, Sign In to add comment