diff --git a/test/unit/core/conversions_test.cpp b/test/unit/core/conversions_test.cpp index 43592af01..abd3d7f8e 100644 --- a/test/unit/core/conversions_test.cpp +++ b/test/unit/core/conversions_test.cpp @@ -284,16 +284,19 @@ SECTION("to string") { REQUIRE( string2bool("true",val) ); REQUIRE( val == true ); - // mapnik::value hashability + // mapnik::value hash() and operator== works for all T in value + mapnik::transcoder tr("utf8"); using values_container = std::unordered_map; values_container vc; - mapnik::value val2(1); - vc[val2] = 1; - REQUIRE( vc[1] == static_cast(1) ); + mapnik::value keys[5] = {true, 1, 3.14159f, tr.transcode("Мапник"), mapnik::value_null()} ; + for (auto const& k : keys) + { + vc.insert({k, 123456789}); + REQUIRE( vc[k] == 123456789 ); + } // mapnik::value << to ostream std::stringstream s; - mapnik::transcoder tr("utf-8"); mapnik::value_unicode_string ustr = tr.transcode("hello world!"); mapnik::value streamable(ustr); s << streamable;