Skip to content

Commit

Permalink
Add failing tests for locale changes
Browse files Browse the repository at this point in the history
re #250
  • Loading branch information
lefticus committed Mar 4, 2016
1 parent 8feff5b commit 457367e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion include/chaiscript/chaiscript_defines.hpp
Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions unittests/compiled_tests.cpp
Expand Up @@ -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");
}


Expand Down

0 comments on commit 457367e

Please sign in to comment.