aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-08-31 00:28:49 +0100
committerMatthew Wild <mwild1@gmail.com>2010-08-31 00:28:49 +0100
commit0c0140fa2d272dd51efb80753ba7c226318a457c (patch)
tree9c806409df8c41870e4df42dea2db0900fe3fad7
parente3718ed22e0f68c3b3f60849a8dcc17edcd8bfc4 (diff)
downloadprosody-0c0140fa2d272dd51efb80753ba7c226318a457c.tar.gz
prosody-0c0140fa2d272dd51efb80753ba7c226318a457c.zip
tests/test_util_jid.lua: Add more tests for JID splitting
-rw-r--r--tests/test_util_jid.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/test_util_jid.lua b/tests/test_util_jid.lua
index ac17f253..a817e644 100644
--- a/tests/test_util_jid.lua
+++ b/tests/test_util_jid.lua
@@ -28,15 +28,18 @@ function split(split)
-- Valid JIDs
test("node@server", "node", "server", nil );
- test("node@server/resource", "node", "server", "resource" );
- test("server", nil, "server", nil );
- test("server/resource", nil, "server", "resource" );
+ test("node@server/resource", "node", "server", "resource" );
+ test("server", nil, "server", nil );
+ test("server/resource", nil, "server", "resource" );
+ test("server/resource@foo", nil, "server", "resource@foo" );
+ test("server/resource@foo/bar", nil, "server", "resource@foo/bar");
-- Always invalid JIDs
test(nil, nil, nil, nil);
test("node@/server", nil, nil, nil);
test("@server", nil, nil, nil);
test("@server/resource", nil, nil, nil);
+ test("@/resource", nil, nil, nil);
end
function bare(bare)