Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions src/test/java/com/beust/jcommander/StringsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,20 @@
import org.testng.Assert;
import org.testng.annotations.Test;

import java.util.Arrays;

@Test
public class StringsTest {

@Test
public void testListJoin() {
String expected = "A, B, C c";
String actual = Strings.join(", ", Arrays.asList("A", "B", "C c"));
Assert.assertEquals(expected, actual);
}

@Test
public void testArrayJoinSpaceDelimiter() {
String expected = "A B C c";
String actual = Strings.join(" ", new String[] { "A", "B", "C c" });
Assert.assertEquals(expected, actual);
Assert.assertEquals(actual, expected);
}

@Test
public void testArrayJoinEmptyDelimiter() {
String expected = "ABC c";
String actual = Strings.join("", new Object[] { "A", "B", "C c" });
Assert.assertEquals(expected, actual);
Assert.assertEquals(actual, expected);
}
}