• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2012 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 libcore.libcore.icu;
18 
19 import static org.junit.Assert.assertEquals;
20 
21 import java.util.Locale;
22 import libcore.icu.DecimalFormatData;
23 import libcore.test.annotation.NonCts;
24 import libcore.test.reasons.NonCtsReasons;
25 
26 import org.junit.Test;
27 import org.junit.runner.RunWith;
28 import org.junit.runners.JUnit4;
29 
30 @NonCts(reason = NonCtsReasons.INTERNAL_APIS)
31 @RunWith(JUnit4.class)
32 public class DecimalFormatDataTest {
33 
34     // http://code.google.com/p/android/issues/detail?id=38844
35     @Test
testDecimalFormatSymbols_es()36     public void testDecimalFormatSymbols_es() {
37         DecimalFormatData es = DecimalFormatData.getInstance(new Locale("es"));
38         assertEquals(',', es.getDecimalSeparator());
39         assertEquals('.', es.getGroupingSeparator());
40 
41         DecimalFormatData es_419 = DecimalFormatData.getInstance(new Locale("es", "419"));
42         assertEquals('.', es_419.getDecimalSeparator());
43         assertEquals(',', es_419.getGroupingSeparator());
44 
45         DecimalFormatData es_US = DecimalFormatData.getInstance(new Locale("es", "US"));
46         assertEquals('.', es_US.getDecimalSeparator());
47         assertEquals(',', es_US.getGroupingSeparator());
48 
49         DecimalFormatData es_MX = DecimalFormatData.getInstance(new Locale("es", "MX"));
50         assertEquals('.', es_MX.getDecimalSeparator());
51         assertEquals(',', es_MX.getGroupingSeparator());
52 
53         DecimalFormatData es_AR = DecimalFormatData.getInstance(new Locale("es", "AR"));
54         assertEquals(',', es_AR.getDecimalSeparator());
55         assertEquals('.', es_AR.getGroupingSeparator());
56     }
57 }
58