summaryrefslogtreecommitdiff
path: root/indra/llui/tests/llurlentry_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/tests/llurlentry_test.cpp')
-rw-r--r--indra/llui/tests/llurlentry_test.cpp66
1 files changed, 66 insertions, 0 deletions
diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp
index 128cd134c1..80be8fcbf7 100644
--- a/indra/llui/tests/llurlentry_test.cpp
+++ b/indra/llui/tests/llurlentry_test.cpp
@@ -545,4 +545,70 @@ namespace tut
"XXX [secondlife:///app/teleport/Ahern/50/50/50/ Teleport to Ahern] YYY",
"[secondlife:///app/teleport/Ahern/50/50/50/ Teleport to Ahern]");
}
+
+ template<> template<>
+ void object::test<11>()
+ {
+ //
+ // test LLUrlEntryHTTPNoProtocol - general URLs without a protocol
+ //
+ LLUrlEntryHTTPNoProtocol url;
+ boost::regex r = url.getPattern();
+
+ testRegex("naked .com URL", r,
+ "see google.com",
+ "google.com");
+
+ testRegex("naked .org URL", r,
+ "see en.wikipedia.org for details",
+ "en.wikipedia.org");
+
+ testRegex("naked .net URL", r,
+ "example.net",
+ "example.net");
+
+ testRegex("naked .edu URL (2 instances)", r,
+ "MIT web site is at web.mit.edu and also www.mit.edu",
+ "web.mit.edu");
+
+ testRegex("don't match e-mail addresses", r,
+ "test@lindenlab.com",
+ "");
+
+ testRegex(".com URL with path", r,
+ "see secondlife.com/status for grid status",
+ "secondlife.com/status");
+
+ testRegex(".com URL with port", r,
+ "secondlife.com:80",
+ "secondlife.com:80");
+
+ testRegex(".com URL with port and path", r,
+ "see secondlife.com:80/status",
+ "secondlife.com:80/status");
+
+ testRegex("www.*.com URL with port and path", r,
+ "see www.secondlife.com:80/status",
+ "www.secondlife.com:80/status");
+
+ testRegex("invalid .com URL [1]", r,
+ "..com",
+ "");
+
+ testRegex("invalid .com URL [2]", r,
+ "you.come",
+ "");
+
+ testRegex("invalid .com URL [3]", r,
+ "recommended",
+ "");
+
+ testRegex("invalid .edu URL", r,
+ "hi there scheduled maitenance has begun",
+ "");
+
+ testRegex("invalid .net URL", r,
+ "foo.netty",
+ "");
+ }
}