Home | History | Annotate | Download | only in tests
      1 /*
      2  * Copyright (C) 2014 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.inputmethod.keyboard.layout.tests;
     18 
     19 import android.test.suitebuilder.annotation.SmallTest;
     20 
     21 import com.android.inputmethod.keyboard.layout.EastSlavic;
     22 import com.android.inputmethod.keyboard.layout.LayoutBase;
     23 import com.android.inputmethod.keyboard.layout.customizer.EastSlavicCustomizer;
     24 import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
     25 
     26 import java.util.Locale;
     27 
     28 /**
     29  * ky: Kyrgyz/east_slavic
     30  */
     31 @SmallTest
     32 public final class TestsKyrgyz extends LayoutTestsBase {
     33     private static final Locale LOCALE = new Locale("ky");
     34     private static final LayoutBase LAYOUT = new EastSlavic(new KyrgyzCustomizer(LOCALE));
     35 
     36     @Override
     37     LayoutBase getLayout() { return LAYOUT; }
     38 
     39     private static class KyrgyzCustomizer extends EastSlavicCustomizer {
     40         KyrgyzCustomizer(final Locale locale) { super(locale); }
     41 
     42         @Override
     43         public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
     44             return builder
     45                     // U+0443: "" CYRILLIC SMALL LETTER U
     46                     // U+04AF: "" CYRILLIC SMALL LETTER STRAIGHT U
     47                     .setMoreKeysOf("\u0443", "\u04AF")
     48                     // U+0435: "" CYRILLIC SMALL LETTER IE
     49                     // U+0451: "" CYRILLIC SMALL LETTER IO
     50                     .setMoreKeysOf("\u0435", "\u0451")
     51                     // U+043D: "" CYRILLIC SMALL LETTER EN
     52                     // U+04A3: "" CYRILLIC SMALL LETTER EN WITH DESCENDER
     53                     .setMoreKeysOf("\u043D", "\u04A3")
     54                     // U+0449: "" CYRILLIC SMALL LETTER SHCHA
     55                     .replaceKeyOfLabel(EastSlavic.ROW1_9, key("\u0449", additionalMoreKey("9")))
     56                     // U+044B: "" CYRILLIC SMALL LETTER YERU
     57                     .replaceKeyOfLabel(EastSlavic.ROW2_2, "\u044B")
     58                     // U+043E: "" CYRILLIC SMALL LETTER O
     59                     // U+04E9: "" CYRILLIC SMALL LETTER BARRED O
     60                     .setMoreKeysOf("\u043E", "\u04E9")
     61                     // U+044D: "" CYRILLIC SMALL LETTER E
     62                     .replaceKeyOfLabel(EastSlavic.ROW2_11, "\u044D")
     63                     // U+0438: "" CYRILLIC SMALL LETTER I
     64                     .replaceKeyOfLabel(EastSlavic.ROW3_5, "\u0438")
     65                     // U+044C: "" CYRILLIC SMALL LETTER SOFT SIGN
     66                     // U+044A: "" CYRILLIC SMALL LETTER HARD SIGN
     67                     .setMoreKeysOf("\u044C", "\u044A");
     68         }
     69     }
     70 }
     71