summaryrefslogtreecommitdiff
path: root/indra/llui/tests
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-01-11 14:06:09 -0800
committerJames Cook <james@lindenlab.com>2010-01-11 14:06:09 -0800
commita36087f5c1851b0bd5eec5788609f35b8a524384 (patch)
treed7057930083ba9499fc8b3783a531b24ac9ea7f1 /indra/llui/tests
parenta570c39bd3ca9ca567ef6a778305b8231535eb70 (diff)
parent370a8592ac4c3b6eb6fd9f6ddd35960b763e634f (diff)
Merge, sync from viewer-2-0, fixed conflict in llinspectavatar.cpp
Diffstat (limited to 'indra/llui/tests')
-rw-r--r--indra/llui/tests/llurlentry_test.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp
index 128cd134c1..38cf7124ce 100644
--- a/indra/llui/tests/llurlentry_test.cpp
+++ b/indra/llui/tests/llurlentry_test.cpp
@@ -545,4 +545,50 @@ 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("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",
+ "");
+ }
}