Add a "C" numeric locale

This commit is contained in:
vitaut
2016-01-29 16:29:46 -08:00
parent 7ee287d3d9
commit 95c0fb5075
2 changed files with 60 additions and 1 deletions

View File

@@ -387,3 +387,12 @@ TEST(FileTest, FdopenError) {
EXPECT_SYSTEM_ERROR_NOASSERT(
f.fdopen("r"), EBADF, "cannot associate stream with file descriptor");
}
#ifdef LC_NUMERIC_MASK
TEST(LocaleTest, Strtod) {
fmt::Locale locale;
const char *start = "4.2", *ptr = start;
EXPECT_EQ(4.2, locale.strtod(ptr));
EXPECT_EQ(start + 3, ptr);
}
#endif