aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornchalko <nchalko@google.com>2018-02-26 09:55:29 -0800
committerNick Chalko <nchalko@google.com>2018-02-26 15:43:18 -0800
commit9c2467845b7c4dbf37f6b7828c8da4e86e6b2d34 (patch)
tree24ec2f50c1e88bdaa61e19458900aaaf3228868e
parent9850ee71f931f597658b39fba8fd18bead506955 (diff)
downloadTV-9c2467845b7c4dbf37f6b7828c8da4e86e6b2d34.tar.gz
CLEANUP: fix vararg errors by inlining vargarg method
PiperOrigin-RevId: 187036672 Change-Id: Ia1550285ca0d4c2d5b0c4ce8ed5638c3e9fe9c7e
-rw-r--r--tests/unit/src/com/android/tv/recommendation/RoutineWatchEvaluatorTest.java31
1 files changed, 18 insertions, 13 deletions
diff --git a/tests/unit/src/com/android/tv/recommendation/RoutineWatchEvaluatorTest.java b/tests/unit/src/com/android/tv/recommendation/RoutineWatchEvaluatorTest.java
index 9af5fd06..39e6e9c5 100644
--- a/tests/unit/src/com/android/tv/recommendation/RoutineWatchEvaluatorTest.java
+++ b/tests/unit/src/com/android/tv/recommendation/RoutineWatchEvaluatorTest.java
@@ -29,7 +29,7 @@ import java.util.concurrent.TimeUnit;
import org.junit.Test;
import org.junit.runner.RunWith;
-/**Tests for {@link RoutineWatchEvaluator}. */
+/** Tests for {@link RoutineWatchEvaluator}. */
@SmallTest
@RunWith(AndroidJUnit4.class)
public class RoutineWatchEvaluatorTest extends EvaluatorTestCase<RoutineWatchEvaluator> {
@@ -66,13 +66,23 @@ public class RoutineWatchEvaluatorTest extends EvaluatorTestCase<RoutineWatchEva
@Test
public void testSplitTextToWords() {
- assertSplitTextToWords("");
- assertSplitTextToWords("Google", "Google");
- assertSplitTextToWords("The Big Bang Theory", "The", "Big", "Bang", "Theory");
- assertSplitTextToWords("Hello, world!", "Hello", "world");
- assertSplitTextToWords("Adam's Rib", "Adam's", "Rib");
- assertSplitTextToWords("G.I. Joe", "G.I", "Joe");
- assertSplitTextToWords("A.I.", "A.I");
+ assertThat(RoutineWatchEvaluator.splitTextToWords("")).containsExactly().inOrder();
+ assertThat(RoutineWatchEvaluator.splitTextToWords("Google"))
+ .containsExactly("Google")
+ .inOrder();
+ assertThat(RoutineWatchEvaluator.splitTextToWords("The Big Bang Theory"))
+ .containsExactly("The", "Big", "Bang", "Theory")
+ .inOrder();
+ assertThat(RoutineWatchEvaluator.splitTextToWords("Hello, world!"))
+ .containsExactly("Hello", "world")
+ .inOrder();
+ assertThat(RoutineWatchEvaluator.splitTextToWords("Adam's Rib"))
+ .containsExactly("Adam's", "Rib")
+ .inOrder();
+ assertThat(RoutineWatchEvaluator.splitTextToWords("G.I. Joe"))
+ .containsExactly("G.I", "Joe")
+ .inOrder();
+ assertThat(RoutineWatchEvaluator.splitTextToWords("A.I.")).containsExactly("A.I").inOrder();
}
@Test
@@ -232,11 +242,6 @@ public class RoutineWatchEvaluatorTest extends EvaluatorTestCase<RoutineWatchEva
RoutineWatchEvaluator.getTimeOfDayInSec(todayAtHourMinSec(23, 59, 59)));
}
- private void assertSplitTextToWords(String text, String... words) {
- List<String> wordList = RoutineWatchEvaluator.splitTextToWords(text);
- assertThat(wordList).containsExactly((Object) words).inOrder();
- }
-
private void assertMaximumMatchedWordSequenceLength(
int expectedLength, String text1, String text2) {
List<String> wordList1 = RoutineWatchEvaluator.splitTextToWords(text1);