mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-27 03:10:23 -06:00
Adjust locale test so that it works on both Ubuntu and MacOS.
This commit is contained in:
parent
f795d7ff59
commit
3cb044c8fc
@ -211,10 +211,20 @@ TEST(gncnumeric_stream, output_stream)
|
|||||||
GncNumeric rational_string(123, 456);
|
GncNumeric rational_string(123, 456);
|
||||||
output << rational_string;
|
output << rational_string;
|
||||||
EXPECT_EQ("123/456", output.str());
|
EXPECT_EQ("123/456", output.str());
|
||||||
|
try
|
||||||
|
{
|
||||||
output.imbue(std::locale("fr_FR.utf8"));
|
output.imbue(std::locale("fr_FR.utf8"));
|
||||||
output.str("");
|
output.str("");
|
||||||
output << simple_int;
|
output << simple_int;
|
||||||
EXPECT_EQ("123 456", output.str());
|
EXPECT_EQ("123 456", output.str());
|
||||||
|
}
|
||||||
|
catch (std::runtime_error)
|
||||||
|
{
|
||||||
|
output.imbue(std::locale("fr_FR"));
|
||||||
|
output.str("");
|
||||||
|
output << simple_int;
|
||||||
|
EXPECT_EQ("123456", output.str());
|
||||||
|
}
|
||||||
output.str("");
|
output.str("");
|
||||||
output << decimal_string;
|
output << decimal_string;
|
||||||
EXPECT_EQ("123,456", output.str());
|
EXPECT_EQ("123,456", output.str());
|
||||||
|
Loading…
Reference in New Issue
Block a user