aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-04-09 21:35:39 +0200
committerdec05eba <dec05eba@protonmail.com>2021-04-09 21:45:28 +0200
commit6040726f92784978dd91eec4c540e92c4ca54236 (patch)
treece37ba29b40bf100c5bd577834ea4b6c90f4ab86 /tests
parent20a437763e56e5429ebd7f38940c4107418e3dee (diff)
Add .onion to list of valid tld, properly parse urls protocol part
Diffstat (limited to 'tests')
-rw-r--r--tests/main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/main.cpp b/tests/main.cpp
index c5138e3..306cdf2 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -28,6 +28,11 @@ int main() {
assert_equals(urls.size(), 1);
assert_equals(urls[0], "example.com");
+ str = "example.com: the best test website";
+ urls = QuickMedia::ranges_get_strings(str, QuickMedia::extract_urls(str));
+ assert_equals(urls.size(), 1);
+ assert_equals(urls[0], "example.com");
+
str = "these. are. not. websites.";
urls = QuickMedia::ranges_get_strings(str, QuickMedia::extract_urls(str));
assert_equals(urls.size(), 0);
@@ -47,5 +52,10 @@ int main() {
urls = QuickMedia::ranges_get_strings(str, QuickMedia::extract_urls(str));
assert_equals(urls.size(), 1);
assert_equals(urls[0], "https://emojipedia.org/emoji/%23%EF%B8%8F%E2%83%A3/");
+
+ str = "[sneed](https://sneedville.com)";
+ urls = QuickMedia::ranges_get_strings(str, QuickMedia::extract_urls(str));
+ assert_equals(urls.size(), 1);
+ assert_equals(urls[0], "https://sneedville.com");
return 0;
}