Changeset 14308 in josm for trunk/test/unit/org
- Timestamp:
- 2018-10-08T20:33:25+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/tools/KeyboardUtilsTest.java
r14289 r14308 5 5 6 6 import java.awt.event.KeyEvent; 7 import java.util.ArrayList; 7 8 import java.util.Arrays; 8 9 import java.util.LinkedHashMap; 10 import java.util.List; 9 11 import java.util.Locale; 10 12 import java.util.Map; … … 55 57 public void testGetCharactersForKeyE00() { 56 58 char deadCircumflex = (char) KeyEvent.VK_DEAD_CIRCUMFLEX; 57 char deadGrave = (char) KeyEvent.VK_DEAD_GRAVE;58 59 char deadCaron = (char) KeyEvent.VK_DEAD_CARON; 59 60 char deadCircumflex2 = 0x2C6; 60 char deadGrave2 = 0x2CB;61 61 char deadCaron2 = 0x2C7; 62 testgetCharactersForKeyE00("ar", 'ذ', '>' , '`', deadGrave, deadGrave2);62 testgetCharactersForKeyE00("ar", 'ذ', '>'); 63 63 if (PlatformManager.isPlatformUnixoid()) { 64 testgetCharactersForKeyE00("fr_FR", '²', '$', 'œ' , '`', deadGrave, deadGrave2);65 testgetCharactersForKeyE00("fr_CA", '#', '$', 'œ', '/' , '`', deadGrave, deadGrave2);64 testgetCharactersForKeyE00("fr_FR", '²', '$', 'œ'); 65 testgetCharactersForKeyE00("fr_CA", '#', '$', 'œ', '/'); 66 66 } else { 67 testgetCharactersForKeyE00("fr_FR", '²', '$' , '`', deadGrave, deadGrave2);68 testgetCharactersForKeyE00("fr_CA", '#', '$', '/' , '`', deadGrave, deadGrave2);67 testgetCharactersForKeyE00("fr_FR", '²', '$'); 68 testgetCharactersForKeyE00("fr_CA", '#', '$', '/'); 69 69 } 70 testgetCharactersForKeyE00("sq", '\\' , '`', deadGrave, deadGrave2);71 testgetCharactersForKeyE00("it", '\\' , '`', deadGrave, deadGrave2);72 testgetCharactersForKeyE00("pt", '\\' , '`', deadGrave, deadGrave2);73 testgetCharactersForKeyE00("pt_BR", '\'' , '`', deadGrave, deadGrave2);74 testgetCharactersForKeyE00("de", deadCircumflex, deadCircumflex2 , '`', deadGrave, deadGrave2);75 testgetCharactersForKeyE00("cs", ';' , '`', deadGrave, deadGrave2);76 testgetCharactersForKeyE00("he" , '`', deadGrave, deadGrave2);77 testgetCharactersForKeyE00("hu", '0' , '`', deadGrave, deadGrave2);78 testgetCharactersForKeyE00("pl" , '`', deadGrave, deadGrave2);79 testgetCharactersForKeyE00("bs", '¸' , '`', deadGrave, deadGrave2);80 testgetCharactersForKeyE00("hr", '¸' , '`', deadGrave, deadGrave2);81 testgetCharactersForKeyE00("sl", '¸' , '`', deadGrave, deadGrave2);82 testgetCharactersForKeyE00("sr", '¸' , '`', deadGrave, deadGrave2);83 testgetCharactersForKeyE00("ro", ']' , '`', deadGrave, deadGrave2);84 testgetCharactersForKeyE00("da", '½' , '`', deadGrave, deadGrave2);85 testgetCharactersForKeyE00("fo", '½' , '`', deadGrave, deadGrave2);86 testgetCharactersForKeyE00("nl", '@' , '`', deadGrave, deadGrave2);87 testgetCharactersForKeyE00("et", deadCaron, deadCaron2 , '`', deadGrave, deadGrave2);88 testgetCharactersForKeyE00("is", '°' , '`', deadGrave, deadGrave2);89 testgetCharactersForKeyE00("es", '|' , '`', deadGrave, deadGrave2);90 testgetCharactersForKeyE00("es_ES", 'º' , '`', deadGrave, deadGrave2);91 testgetCharactersForKeyE00("tr", '"', '*' , '`', deadGrave, deadGrave2);92 testgetCharactersForKeyE00("de_LU", deadCircumflex, deadCircumflex2, '²', '§' , '`', deadGrave, deadGrave2);70 testgetCharactersForKeyE00("sq", '\\'); 71 testgetCharactersForKeyE00("it", '\\'); 72 testgetCharactersForKeyE00("pt", '\\'); 73 testgetCharactersForKeyE00("pt_BR", '\''); 74 testgetCharactersForKeyE00("de", deadCircumflex, deadCircumflex2); 75 testgetCharactersForKeyE00("cs", ';'); 76 testgetCharactersForKeyE00("he"); 77 testgetCharactersForKeyE00("hu", '0'); 78 testgetCharactersForKeyE00("pl"); 79 testgetCharactersForKeyE00("bs", '¸'); 80 testgetCharactersForKeyE00("hr", '¸'); 81 testgetCharactersForKeyE00("sl", '¸'); 82 testgetCharactersForKeyE00("sr", '¸'); 83 testgetCharactersForKeyE00("ro", ']'); 84 testgetCharactersForKeyE00("da", '½'); 85 testgetCharactersForKeyE00("fo", '½'); 86 testgetCharactersForKeyE00("nl", '@'); 87 testgetCharactersForKeyE00("et", deadCaron, deadCaron2); 88 testgetCharactersForKeyE00("is", '°'); 89 testgetCharactersForKeyE00("es", '|'); 90 testgetCharactersForKeyE00("es_ES", 'º'); 91 testgetCharactersForKeyE00("tr", '"', '*'); 92 testgetCharactersForKeyE00("de_LU", deadCircumflex, deadCircumflex2, '²', '§'); 93 93 if (PlatformManager.isPlatformUnixoid()) { 94 testgetCharactersForKeyE00("fr_LU", '$', 'œ', '²', '§' , '`', deadGrave, deadGrave2);95 testgetCharactersForKeyE00("fr_CH", '²', '$', 'œ', '§' , '`', deadGrave, deadGrave2);94 testgetCharactersForKeyE00("fr_LU", '$', 'œ', '²', '§'); 95 testgetCharactersForKeyE00("fr_CH", '²', '$', 'œ', '§'); 96 96 } else { 97 testgetCharactersForKeyE00("fr_LU", '$', '²', '§' , '`', deadGrave, deadGrave2);98 testgetCharactersForKeyE00("fr_CH", '²', '$', '§' , '`', deadGrave, deadGrave2);97 testgetCharactersForKeyE00("fr_LU", '$', '²', '§'); 98 testgetCharactersForKeyE00("fr_CH", '²', '$', '§'); 99 99 } 100 testgetCharactersForKeyE00("de_CH", deadCircumflex, deadCircumflex2, '§' , '`', deadGrave, deadGrave2);101 testgetCharactersForKeyE00("de_LI", deadCircumflex, deadCircumflex2, '§' , '`', deadGrave, deadGrave2);102 testgetCharactersForKeyE00("fi_FI", '§' , '`', deadGrave, deadGrave2);103 testgetCharactersForKeyE00("sv_SE", '§' , '`', deadGrave, deadGrave2);104 testgetCharactersForKeyE00("no_NO", '|' , '`', deadGrave, deadGrave2);105 testgetCharactersForKeyE00("sv_NO", '|' , '`', deadGrave, deadGrave2);100 testgetCharactersForKeyE00("de_CH", deadCircumflex, deadCircumflex2, '§'); 101 testgetCharactersForKeyE00("de_LI", deadCircumflex, deadCircumflex2, '§'); 102 testgetCharactersForKeyE00("fi_FI", '§'); 103 testgetCharactersForKeyE00("sv_SE", '§'); 104 testgetCharactersForKeyE00("no_NO", '|'); 105 testgetCharactersForKeyE00("sv_NO", '|'); 106 106 } 107 107 … … 116 116 117 117 private static void testgetCharactersForKeyE00(Locale locale, Character... expected) { 118 assertEquals(Arrays.asList(expected), KeyboardUtils.getCharactersForKey('E', 0, locale)); 118 List<Character> realExpected = new ArrayList<>(Arrays.asList(expected)); 119 // Add characters common to all cases 120 if (PlatformManager.isPlatformOsx()) { 121 realExpected.add('§'); 122 } 123 char deadGrave = (char) KeyEvent.VK_DEAD_GRAVE; 124 char deadGrave2 = 0x2CB; 125 realExpected.addAll(Arrays.asList('`', deadGrave, deadGrave2)); 126 assertEquals(realExpected, KeyboardUtils.getCharactersForKey('E', 0, locale)); 119 127 } 120 128 }
Note:
See TracChangeset
for help on using the changeset viewer.