FormatterTest.java revision 8cdf9790e869778b0ed3da7f149cb7c132a0f142
1/*
2 * Copyright (C) 2009 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
17package java.util;
18
19import junit.framework.Test;
20import junit.framework.TestSuite;
21
22public class FormatterTest extends junit.framework.TestCase {
23    // http://b/2301938
24    public void test_uppercaseConversions() throws Exception {
25        // In most locales, the upper-case equivalent of "i" is "I".
26        assertEquals("JAKOB ARJOUNI", String.format(Locale.US, "%S", "jakob arjouni"));
27        // In Turkish-language locales, there's a dotted capital "i".
28        assertEquals("JAKOB ARJOUN\u0130", String.format(new Locale("tr", "TR"), "%S", "jakob arjouni"));
29    }
30}
31