Skip to content

Commit

Permalink
Added two more tests (#942)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesper-friis authored Sep 6, 2024
1 parent 32f09e5 commit 213a063
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/utils/tests/test_uri_encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 213a063

Please sign in to comment.