From 213a063140e8f72878b2cb24891c5075aaa48ddc Mon Sep 17 00:00:00 2001 From: Jesper Friis Date: Fri, 6 Sep 2024 09:17:03 +0200 Subject: [PATCH] Added two more tests (#942) --- src/utils/tests/test_uri_encode.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/utils/tests/test_uri_encode.c b/src/utils/tests/test_uri_encode.c index 701332663..3472c0344 100644 --- a/src/utils/tests/test_uri_encode.c +++ b/src/utils/tests/test_uri_encode.c @@ -19,6 +19,16 @@ MU_TEST(test_encode_something) { mu_assert_string_eq("something", buf); mu_assert_int_eq(9, n); } +MU_TEST(test_encode_something_percent) { + int n = uri_encode("something%", 10, buf); + mu_assert_string_eq("something%25", buf); + mu_assert_int_eq(12, n); +} +MU_TEST(test_encode_something_zslash) { + int n = uri_encode("something%z/", 12, buf); + mu_assert_string_eq("something%25z%2F", buf); + mu_assert_int_eq(16, n); +} MU_TEST(test_encode_space) { int n = uri_encode(" ", 1, buf); mu_assert_string_eq("%20", buf); @@ -139,6 +149,8 @@ MU_TEST_SUITE(test_suite) { MU_RUN_TEST(test_encode_empty); MU_RUN_TEST(test_encode_something); + MU_RUN_TEST(test_encode_something_percent); + MU_RUN_TEST(test_encode_something_zslash); MU_RUN_TEST(test_encode_percent); MU_RUN_TEST(test_encode_space); MU_RUN_TEST(test_encode_empty);