mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-02-10 14:49:59 +01:00
test: Numpad scripts
This commit is contained in:
parent
7c85870352
commit
fe7906a194
@ -13,4 +13,23 @@ public class KeyValueTest
|
|||||||
{
|
{
|
||||||
assertEquals(KeyValue.makeStringKeyWithSymbol("Foo", "Symbol", 0), KeyValue.makeStringKeyWithSymbol("Foo", "Symbol", 0));
|
assertEquals(KeyValue.makeStringKeyWithSymbol("Foo", "Symbol", 0), KeyValue.makeStringKeyWithSymbol("Foo", "Symbol", 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void numpad_script()
|
||||||
|
{
|
||||||
|
assertEquals(apply_numpad_script("hindu-arabic"), "٠١٢٣٤٥٦٧٨٩");
|
||||||
|
assertEquals(apply_numpad_script("bengali"), "০১২৩৪৫৬৭৮৯");
|
||||||
|
assertEquals(apply_numpad_script("devanagari"), "०१२३४५६७८९");
|
||||||
|
assertEquals(apply_numpad_script("persian"), "۰۱۲۳۴۵۶۷۸۹");
|
||||||
|
assertEquals(apply_numpad_script("gujarati"), "૦૧૨૩૪૫૬૭૮૯");
|
||||||
|
assertEquals(apply_numpad_script("kannada"), "೦೧೨೩೪೫೬೭೮೯");
|
||||||
|
}
|
||||||
|
String apply_numpad_script(String script)
|
||||||
|
{
|
||||||
|
StringBuilder b = new StringBuilder();
|
||||||
|
KeyModifier.Map_char map = KeyModifier.modify_numpad_script(script);
|
||||||
|
for (char c : "0123456789".toCharArray())
|
||||||
|
b.append(map.apply(c));
|
||||||
|
return b.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user