diff options
Diffstat (limited to 'src/test/java/com/google/devtools/common/options/CommaSeparatedOptionListConverterTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/common/options/CommaSeparatedOptionListConverterTest.java | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/src/test/java/com/google/devtools/common/options/CommaSeparatedOptionListConverterTest.java b/src/test/java/com/google/devtools/common/options/CommaSeparatedOptionListConverterTest.java index 6d0e053eca..29491921ce 100644 --- a/src/test/java/com/google/devtools/common/options/CommaSeparatedOptionListConverterTest.java +++ b/src/test/java/com/google/devtools/common/options/CommaSeparatedOptionListConverterTest.java @@ -13,20 +13,15 @@ // limitations under the License. package com.google.devtools.common.options; -import static org.junit.Assert.assertEquals; +import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.fail; +import java.util.List; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -/** - * A test for {@link Converters.CommaSeparatedOptionListConverter}. - */ +/** A test for {@link Converters.CommaSeparatedOptionListConverter}. */ @RunWith(JUnit4.class) public class CommaSeparatedOptionListConverterTest { @@ -35,41 +30,40 @@ public class CommaSeparatedOptionListConverterTest { @Test public void emptyStringYieldsEmptyList() throws Exception { - assertEquals(Collections.emptyList(), converter.convert("")); + assertThat(converter.convert("")).isEmpty(); } @Test public void commaTwoEmptyStrings() throws Exception { - assertEquals(Arrays.asList("", ""), converter.convert(",")); + assertThat(converter.convert(",")).containsExactly("", "").inOrder(); } @Test public void leadingCommaYieldsLeadingSpace() throws Exception { - assertEquals(Arrays.asList("", "leading", "comma"), - converter.convert(",leading,comma")); + assertThat(converter.convert(",leading,comma")) + .containsExactly("", "leading", "comma").inOrder(); } @Test public void trailingCommaYieldsTrailingSpace() throws Exception { - assertEquals(Arrays.asList("trailing", "comma", ""), - converter.convert("trailing,comma,")); + assertThat(converter.convert("trailing,comma,")) + .containsExactly("trailing", "comma", "").inOrder(); } @Test public void singleWord() throws Exception { - assertEquals(Arrays.asList("lonely"), converter.convert("lonely")); + assertThat(converter.convert("lonely")).containsExactly("lonely"); } @Test public void multiWords() throws Exception { - assertEquals(Arrays.asList("one", "two", "three"), - converter.convert("one,two,three")); + assertThat(converter.convert("one,two,three")) + .containsExactly("one", "two", "three").inOrder(); } @Test public void spaceIsIgnored() throws Exception { - assertEquals(Arrays.asList("one two three"), - converter.convert("one two three")); + assertThat(converter.convert("one two three")).containsExactly("one two three"); } @Test |