summaryrefslogtreecommitdiff
path: root/indra/llui/tests
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2010-01-12 12:53:44 +0200
committerMike Antipov <mantipov@productengine.com>2010-01-12 12:53:44 +0200
commit3c3271761b918a19f7a10d80da9dd23e5127de2c (patch)
treed4205dd5827c215b2cb615bc364b01b1b7eada0d /indra/llui/tests
parent13148203a440cf1bb36c928a8677bfeb7c0e32d6 (diff)
parent3b2697cb93e6b8a1f1281aeab0e960bc6704d8c4 (diff)
Merge with default branch, resolved conflict in llpanelavatar.cpp
--HG-- branch : product-engine
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",
+ "");
+ }
}