summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-07-18 01:22:01 -0700
committerSunny Goyal <sunnygoyal@google.com>2017-07-18 11:23:23 -0700
commit05d2df1678bfba02c2fbc54ce03229f45b0308cd (patch)
tree92bef2d68d4197ef8eb9c8724750887057ddf023 /tests
parent751ea1c10e8e2348a9c0d0a22f8b9df3c9416c1f (diff)
downloadandroid_packages_apps_Trebuchet-05d2df1678bfba02c2fbc54ce03229f45b0308cd.tar.gz
android_packages_apps_Trebuchet-05d2df1678bfba02c2fbc54ce03229f45b0308cd.tar.bz2
android_packages_apps_Trebuchet-05d2df1678bfba02c2fbc54ce03229f45b0308cd.zip
Using collator for string matching
This provides a better matching for non-latin characters on N and above Bug: 63763127 Change-Id: I220487d242ff547311ddd13e7af380a7e47eec0e
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) {