summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-07-18 18:23:35 +0000
committerSunny Goyal <sunnygoyal@google.com>2017-07-18 18:23:35 +0000
commiteb297820a2604badf7e84c1249d36b63d666a3f2 (patch)
treec5133381f55a9e3734089fce40193b0e213ab5d5 /tests
parenta911c4b3a0d325c369fa39f2bd4c5fefc2edc691 (diff)
parent05d2df1678bfba02c2fbc54ce03229f45b0308cd (diff)
downloadandroid_packages_apps_Trebuchet-eb297820a2604badf7e84c1249d36b63d666a3f2.tar.gz
android_packages_apps_Trebuchet-eb297820a2604badf7e84c1249d36b63d666a3f2.tar.bz2
android_packages_apps_Trebuchet-eb297820a2604badf7e84c1249d36b63d666a3f2.zip
Using collator for string matching am: 05d2df1678
Change-Id: I0e25b3d84cac2d09491aa87c7dafb2c24e12d556
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithmTest.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithmTest.java b/tests/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithmTest.java
index 58dc0c43e..26ec69b1c 100644
--- a/tests/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithmTest.java
+++ b/tests/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithmTest.java
@@ -19,6 +19,7 @@ import android.content.ComponentName;
import android.test.InstrumentationTestCase;
import com.android.launcher3.AppInfo;
+import com.android.launcher3.Utilities;
import java.util.ArrayList;
import java.util.List;
@@ -75,6 +76,25 @@ public class DefaultAppSearchAlgorithmTest extends InstrumentationTestCase {
assertTrue(mAlgorithm.matches(getInfo("电子邮件"), "电子"));
assertFalse(mAlgorithm.matches(getInfo("电子邮件"), "子"));
assertFalse(mAlgorithm.matches(getInfo("电子邮件"), "邮件"));
+
+ assertFalse(mAlgorithm.matches(getInfo("Bot"), "ba"));
+ assertFalse(mAlgorithm.matches(getInfo("bot"), "ba"));
+ }
+
+ public void testMatchesVN() {
+ if (!Utilities.ATLEAST_NOUGAT) {
+ return;
+ }
+ assertTrue(mAlgorithm.matches(getInfo("다운로드"), "다"));
+ assertTrue(mAlgorithm.matches(getInfo("드라이브"), "드"));
+ assertTrue(mAlgorithm.matches(getInfo("다운로드 드라이브"), "ㄷ"));
+ assertTrue(mAlgorithm.matches(getInfo("운로 드라이브"), "ㄷ"));
+ assertTrue(mAlgorithm.matches(getInfo("abc"), "åbç"));
+ assertTrue(mAlgorithm.matches(getInfo("Alpha"), "ål"));
+
+ assertFalse(mAlgorithm.matches(getInfo("다운로드 드라이브"), "ㄷㄷ"));
+ assertFalse(mAlgorithm.matches(getInfo("로드라이브"), "ㄷ"));
+ assertFalse(mAlgorithm.matches(getInfo("abc"), "åç"));
}
private AppInfo getInfo(String title) {