aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/liberty.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/liberty.c b/tests/liberty.c
index 65847fe..b55fe2c 100644
--- a/tests/liberty.c
+++ b/tests/liberty.c
@@ -326,6 +326,11 @@ test_str_map (void)
static void
test_utf8 (void)
{
+ const char *full = "\xc5\x99", *partial = full, *empty = full;
+ soft_assert (utf8_decode (&full, 2) == 0x0159);
+ soft_assert (utf8_decode (&partial, 1) == -2);
+ soft_assert (utf8_decode (&empty, 0) == -1);
+
const char valid [] = "2H₂ + O₂ ⇌ 2H₂O, R = 4.7 kΩ, ⌀ 200 mm";
const char invalid[] = "\xf0\x90\x28\xbc";
soft_assert ( utf8_validate (valid, sizeof valid));