Revision b66ab10252010fae296ae88aca3b59241bf68137 authored by Shan-Chun Kuo on 07 April 2017, 16:03:30 UTC, committed by Shan-Chun Kuo on 07 April 2017, 16:03:30 UTC
1 parent 682a272
Raw File
unit.cpp
#define CATCH_CONFIG_MAIN
#include "catch/catch.hpp"
#include "text.hpp"

TEST_CASE("UTF-8 enforcement", "[utf8]") {
	REQUIRE(check_utf8("") == std::string(""));
	REQUIRE(check_utf8("hello world") == std::string(""));
	REQUIRE(check_utf8("Καλημέρα κόσμε") == std::string(""));
	REQUIRE(check_utf8("こんにちは 世界") == std::string(""));
	REQUIRE(check_utf8("👋🌏") == std::string(""));
	REQUIRE(check_utf8("Hola m\xF3n") == std::string("\"Hola m\xF3n\" is not valid UTF-8 (0xF3 0x6E)"));
}
back to top