Make test independent from machine locale

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1507797 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benedikt Ritter 2013-07-28 13:16:36 +00:00
parent d1a45e9738
commit 3fcbc4a4fa
1 changed files with 6 additions and 1 deletions

View File

@ -19,6 +19,8 @@ package org.apache.commons.lang3.text;
import org.junit.Test;
import static org.junit.Assert.*;
import java.text.DecimalFormatSymbols;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
@ -1024,7 +1026,10 @@ public class StrBuilderAppendInsertTest {
sb = new StrBuilder();
sb.append("Hi %s %,d", "Alice", 5000);
assertEquals("Hi Alice 5,000", sb.toString());
// group separator depends on system locale
char groupingSeparator = DecimalFormatSymbols.getInstance().getGroupingSeparator();
String expected = "Hi Alice 5" + groupingSeparator + "000";
assertEquals(expected, sb.toString());
}
//-----------------------------------------------------------------------