Add failing tests for locale changes

re #250
This commit is contained in:
Jason Turner
2016-03-04 14:31:19 -07:00
parent 8feff5bc76
commit 457367ea7b
3 changed files with 12 additions and 2 deletions

View File

@@ -933,7 +933,17 @@ TEST_CASE("Map conversions")
)");
CHECK(c == 42);
}
TEST_CASE("Parse floats with non-posix locale")
{
std::cout << "Current locale: " << std::setlocale(LC_ALL, "en_ZA.utf8") << '\n';
chaiscript::ChaiScript chai;
const double parsed = chai.eval<double>("print(1.3); 1.3");
CHECK(parsed == 1.3);
const std::string str = chai.eval<std::string>("to_string(1.3)");
CHECK(str == "1.3");
}