-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bux where Strings.join returns empty String (#2465)
- Loading branch information
Showing
4 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.testng.util; | ||
|
||
import org.testng.annotations.Test; | ||
|
||
import static org.testng.Assert.assertEquals; | ||
|
||
/** | ||
* Unit tests for {@link Strings} | ||
*/ | ||
public class StringsTest { | ||
@Test | ||
public void joinEmptyArray() { | ||
String[] emptyArray = new String[0]; | ||
assertEquals(Strings.join(",", emptyArray), ""); | ||
} | ||
|
||
@Test | ||
public void joinArrayWithOneElement() { | ||
String[] array = new String[]{"one"}; | ||
assertEquals(Strings.join(",", array), "one"); | ||
} | ||
|
||
@Test | ||
public void joinArrayWithTwoElements() { | ||
String[] array = new String[]{"one", "two"}; | ||
assertEquals(Strings.join(",", array), "one,two"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters