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

@ -103,7 +103,7 @@ set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/description.txt"
set(CPACK_PACKAGE_VERSION_MAJOR 5)
set(CPACK_PACKAGE_VERSION_MINOR 8)
set(CPACK_PACKAGE_VERSION_PATCH 0)
set(CPACK_PACKAGE_VERSION_PATCH 1)
set(CPACK_PACKAGE_EXECUTABLES "chai;ChaiScript Eval")
set(CPACK_PACKAGE_VENDOR "ChaiScript.com")

View File

@ -97,7 +97,7 @@
namespace chaiscript {
static const int version_major = 5;
static const int version_minor = 8;
static const int version_patch = 0;
static const int version_patch = 1;
static const char *compiler_version = CHAISCRIPT_COMPILER_VERSION;
static const char *compiler_name = CHAISCRIPT_COMPILER_NAME;

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");
}