aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
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;
}