summaryrefslogtreecommitdiffhomepage
path: root/src/test-unicode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test-unicode.cpp')
-rw-r--r--src/test-unicode.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test-unicode.cpp b/src/test-unicode.cpp
new file mode 100644
index 0000000..9d41e67
--- /dev/null
+++ b/src/test-unicode.cpp
@@ -0,0 +1,17 @@
+#define BOOST_TEST_MODULE unicode_test
+
+#include <boost/test/included/unit_test.hpp>
+
+#include <string>
+
+#include <unicode.h>
+
+BOOST_AUTO_TEST_CASE(utf8_to_utf16)
+{
+ std::u8string u8{"ascii string1"};
+
+ std::u16string u16{unicode::utf8_to_utf16(u8)};
+
+ BOOST_CHECK_EQ(u16, u"ascii string1");
+}
+