@@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: BSD-2-Clause
#include "idna/unicode.h"
#include "unicode/unicode.h"
#include "etest/etest2.h"
@@ -10,20 +10,20 @@ int main() {
etest::Suite s{};
s.add_test("not decomposed", [](etest::IActions &a) {
a.expect_eq(idna::Unicode::decompose("abc123xyz"), "abc123xyz"); //
a.expect_eq(unicode::Unicode::decompose("abc123xyz"), "abc123xyz"); //
});
s.add_test("decomposed", [](etest::IActions &a) {
// A + COMBINING RING ABOVE
a.expect_eq(idna::Unicode::decompose("Å"), "A\xcc\x8a");
a.expect_eq(unicode::Unicode::decompose("Å"), "A\xcc\x8a");
// s + COMBINING DOT BELOW + COMBINING DOT ABOVE
a.expect_eq(idna::Unicode::decompose("ṩ"), "s\xcc\xa3\xcc\x87");
a.expect_eq(unicode::Unicode::decompose("ṩ"), "s\xcc\xa3\xcc\x87");
});
s.add_test("mixed", [](etest::IActions &a) {
// s + COMBINING DOT BELOW + COMBINING DOT ABOVE
a.expect_eq(idna::Unicode::decompose("123ṩ567"),
a.expect_eq(unicode::Unicode::decompose("123ṩ567"),
"123"
"s\xcc\xa3\xcc\x87"
"567");