aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/main.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/tests/main.cpp b/tests/main.cpp
index 38dd534..647fdff 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -7,32 +7,44 @@
int main() {
std::vector<std::string> urls;
- urls = QuickMedia::extract_urls("example.com");
+ urls.clear();
+ QuickMedia::extract_urls("example.com", urls);
assert_equals(urls.size(), 1);
assert_equals(urls[0], "example.com");
- urls = QuickMedia::extract_urls("example.com, is where I like to go");
+ urls.clear();
+ QuickMedia::extract_urls("example.com, is where I like to go", urls);
assert_equals(urls.size(), 1);
assert_equals(urls[0], "example.com");
- urls = QuickMedia::extract_urls("The website I like to go to is example.com");
+ urls.clear();
+ QuickMedia::extract_urls("The website I like to go to is example.com", urls);
assert_equals(urls.size(), 1);
assert_equals(urls[0], "example.com");
- urls = QuickMedia::extract_urls("example.com. Is also a website");
+ urls.clear();
+ QuickMedia::extract_urls("example.com. Is also a website", urls);
assert_equals(urls.size(), 1);
assert_equals(urls[0], "example.com");
- urls = QuickMedia::extract_urls("these. are. not. websites.");
+ urls.clear();
+ QuickMedia::extract_urls("these. are. not. websites.", urls);
assert_equals(urls.size(), 0);
- urls = QuickMedia::extract_urls("This is not an url: example.");
+ urls.clear();
+ QuickMedia::extract_urls("This is not an url: example.", urls);
assert_equals(urls.size(), 0);
- urls = QuickMedia::extract_urls("the.se/~#423-_/2f.no/3df a.re considered sub.websit.es");
+ urls.clear();
+ QuickMedia::extract_urls("the.se/~#423-_/2f.no/3df a.re considered sub.websit.es", urls);
assert_equals(urls.size(), 3);
assert_equals(urls[0], "the.se/~#423-_/2f.no/3df");
assert_equals(urls[1], "a.re");
assert_equals(urls[2], "sub.websit.es");
+
+ urls.clear();
+ QuickMedia::extract_urls("(see https://emojipedia.org/emoji/%23%EF%B8%8F%E2%83%A3/)", urls);
+ assert_equals(urls.size(), 1);
+ assert_equals(urls[0], "https://emojipedia.org/emoji/%23%EF%B8%8F%E2%83%A3/");
return 0;
}