Skip to content

Commit

Permalink
MONDRIAN: Fix unicode symbols.
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 6983]
  • Loading branch information
julianhyde committed Jun 22, 2006
1 parent a15cc4b commit 83c522a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
10 changes: 8 additions & 2 deletions testsrc/main/mondrian/test/I18nTest.java
Expand Up @@ -25,6 +25,11 @@
* @version $Id$
*/
public class I18nTest extends FoodMartTestCase {
public static final char Euro = '\u20AC';
public static final char Nbsp = '\u00A0';
public static final char EA = '\u00e9'; // e acute
public static final char UC = '\u00FB'; // u circumflex

public void testFormat() {
// Make sure Util is loaded, so that the LocaleFormatFactory gets
// registered.
Expand All @@ -39,7 +44,8 @@ public void testFormat() {

// Currency too
Format currencyFormat = new Format("Currency", spanish);
assertEquals("1.234.567,79 €", currencyFormat.format(new Double(1234567.789)));
assertEquals("1.234.567,79 " + Euro,
currencyFormat.format(new Double(1234567.789)));

// Dates
Format dateFormat = new Format("Medium Date", spanish);
Expand All @@ -58,7 +64,7 @@ public void testFormat() {
public void testAutoFrench() {
// Create a connection in French.
String localeName = "fr_FR";
String resultString = "12\u00A0345,67";
String resultString = "12" + Nbsp + "345,67";
assertFormatNumber(localeName, resultString);
}

Expand Down
15 changes: 8 additions & 7 deletions testsrc/main/mondrian/util/FormatTest.java
Expand Up @@ -17,6 +17,7 @@
import java.util.Arrays;

import mondrian.olap.Util;
import mondrian.test.I18nTest;

/**
* Unit test for {@link Format}.
Expand Down Expand Up @@ -296,23 +297,23 @@ public void testTrickyDates() {

public void testFrenchLocale() {
Format.FormatLocale fr = Format.createLocale(Locale.FRANCE);
assertEquals("#,##0.00 €", fr.currencyFormat);
assertEquals(", fr.currencySymbol);
assertEquals("#,##0.00 " + I18nTest.Euro, fr.currencyFormat);
assertEquals(I18nTest.Euro + "", fr.currencySymbol);
assertEquals("/", fr.dateSeparator);
assertEquals(
"[, dimanche, lundi, mardi, mercredi, jeudi, vendredi, samedi]",
Arrays.asList(fr.daysOfWeekLong).toString());
assertEquals(
"[, dim., lun., mar., mer., jeu., ven., sam.]",
Arrays.asList(fr.daysOfWeekShort).toString());
assertEquals("[janvier, février, mars, avril, mai, juin," +
" juillet, août, septembre, octobre, novembre, décembre, ]",
assertEquals("[janvier, f" + I18nTest.EA + "vrier, mars, avril, mai, juin," +
" juillet, ao" + I18nTest.UC + "t, septembre, octobre, novembre, d" + I18nTest.EA + "cembre, ]",
Arrays.asList(fr.monthsLong).toString());
assertEquals("[janv., févr., mars, avr., mai, juin," +
" juil., août, sept., oct., nov., déc., ]",
assertEquals("[janv., f" + I18nTest.EA + "vr., mars, avr., mai, juin," +
" juil., ao" + I18nTest.UC + "t, sept., oct., nov., d" + I18nTest.EA + "c., ]",
Arrays.asList(fr.monthsShort).toString());
assertEquals(',', fr.decimalPlaceholder);
assertEquals('\u00a0', fr.thousandSeparator);
assertEquals(I18nTest.Nbsp, fr.thousandSeparator);
assertEquals(":", fr.timeSeparator);
}

Expand Down

0 comments on commit 83c522a

Please sign in to comment.