aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_util_jid.lua
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2009-11-29 21:33:37 +0100
committerTobias Markmann <tm@ayena.de>2009-11-29 21:33:37 +0100
commitf91009f78a46ad74aa62ff487fa297c06a1ae6a3 (patch)
tree8ef6302fc66fdc48b4f34f58c3bea877d7ee6bee /tests/test_util_jid.lua
parent8db68f17623ad29b25c6b5d757a2fb0b3d3005c6 (diff)
parent8fcbba4b0fccb299121083d97cab065e51fba9d1 (diff)
downloadprosody-f91009f78a46ad74aa62ff487fa297c06a1ae6a3.tar.gz
prosody-f91009f78a46ad74aa62ff487fa297c06a1ae6a3.zip
Merge with tip.
Diffstat (limited to 'tests/test_util_jid.lua')
-rw-r--r--tests/test_util_jid.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_util_jid.lua b/tests/test_util_jid.lua
index fe6ec74e..f579e597 100644
--- a/tests/test_util_jid.lua
+++ b/tests/test_util_jid.lua
@@ -6,6 +6,16 @@
-- COPYING file in the source package for more information.
--
+function join(join)
+ assert_equal(join("a", "b", "c"), "a@b/c", "builds full JID");
+ assert_equal(join("a", "b", nil), "a@b", "builds bare JID");
+ assert_equal(join(nil, "b", "c"), "b/c", "builds full host JID");
+ assert_equal(join(nil, "b", nil), "b", "builds bare host JID");
+ assert_equal(join(nil, nil, nil), nil, "invalid JID is nil");
+ assert_equal(join("a", nil, nil), nil, "invalid JID is nil");
+ assert_equal(join(nil, nil, "c"), nil, "invalid JID is nil");
+ assert_equal(join("a", nil, "c"), nil, "invalid JID is nil");
+end
function split(split)
@@ -43,3 +53,4 @@ function bare(bare)
assert_equal(bare("user@@host/resource"), nil, "invalid JID is nil");
assert_equal(bare("user@host/"), nil, "invalid JID is nil");
end
+