diff --git a/test/menu.c b/test/menu.c index 93fd4c0..b578ae1 100644 --- a/test/menu.c +++ b/test/menu.c @@ -39,6 +39,29 @@ TEST test_extract_urls_from_two_url_string(void) PASS(); } +TEST test_extract_urls_from_one_url_port(void) +{ + char *urls = extract_urls("Hi from https://www.example.com:8100 and have a nice day!"); + ASSERT_STR_EQ("https://www.example.com:8100", urls); + g_free(urls); + PASS(); +} + +TEST test_extract_urls_from_one_url_path(void) +{ + char *urls = extract_urls("Hi from https://www.example.com:8100/testpath and have a nice day!"); + ASSERT_STR_EQ("https://www.example.com:8100/testpath", urls); + g_free(urls); + PASS(); +} + +TEST test_extract_urls_from_one_url_anchor(void) +{ + char *urls = extract_urls("Hi from https://www.example.com:8100/testpath#anchor and have a nice day!"); + ASSERT_STR_EQ("https://www.example.com:8100/testpath#anchor", urls); + g_free(urls); + PASS(); +} SUITE(suite_menu) { @@ -46,5 +69,8 @@ SUITE(suite_menu) RUN_TEST(test_extract_urls_from_no_urls_string); RUN_TEST(test_extract_urls_from_one_url_string); RUN_TEST(test_extract_urls_from_two_url_string); + RUN_TEST(test_extract_urls_from_one_url_port); + RUN_TEST(test_extract_urls_from_one_url_path); + RUN_TEST(test_extract_urls_from_one_url_anchor); } /* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */