test/test_Stl_String.cpp in rice-4.1.0 vs test/test_Stl_String.cpp in rice-4.2.0

- old
+ new

@@ -25,11 +25,14 @@ { VALUE value = detail::to_ruby(std::string("Some String")); Object object(value); Object encoding = object.call("encoding"); Object encodingName = encoding.call("name"); - ASSERT_EQUAL("ASCII-8BIT", detail::From_Ruby<std::string>().convert(encodingName)); + std::string result = detail::From_Ruby<std::string>().convert(encodingName); + if(result != "ASCII-8BIT" && result != "US-ASCII" && result != "UTF-8") { + FAIL("Encoding incorrect", "ASCII-8BIT, US-ASCII, or UTF-8 (Windows)", result); + } } TESTCASE(std_string_to_ruby_encoding_utf8) { rb_encoding* defaultEncoding = rb_default_external_encoding(); @@ -69,6 +72,6 @@ TESTCASE(std_string_from_ruby_with_binary) { std::string got = detail::From_Ruby<std::string>().convert(rb_str_new("\000test", 5)); ASSERT_EQUAL(5ul, got.length()); ASSERT_EQUAL(std::string("\000test", 5), got); -} \ No newline at end of file +}