aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_util_jid.lua
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2008-11-10 16:29:19 +0100
committerTobias Markmann <tm@ayena.de>2008-11-10 16:29:19 +0100
commit3bbc4e33918539c38c8266cffd0495c68fcbebf6 (patch)
treee7f84ad442da82e00b4b1ac874e85e01043bbe57 /tests/test_util_jid.lua
parentc4d2deffc64a4d955e52d7e8b2dce3af444872c7 (diff)
parenteea12d2279cd8f1e41c9234430e961754be6ce76 (diff)
downloadprosody-3bbc4e33918539c38c8266cffd0495c68fcbebf6.tar.gz
prosody-3bbc4e33918539c38c8266cffd0495c68fcbebf6.zip
Merging.
Diffstat (limited to 'tests/test_util_jid.lua')
-rw-r--r--tests/test_util_jid.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/test_util_jid.lua b/tests/test_util_jid.lua
index 3be0bfa1..1dbd72b7 100644
--- a/tests/test_util_jid.lua
+++ b/tests/test_util_jid.lua
@@ -1,13 +1,14 @@
function split(split)
- function test(jid, node, server, resource)
- local rnode, rserver, rresource = split(jid);
- assert_equal(node, rnode, "split("..jid..") failed");
- assert_equal(server, rserver, "split("..jid..") failed");
- assert_equal(resource, rresource, "split("..jid..") failed");
+ function test(input_jid, expected_node, expected_server, expected_resource)
+ local rnode, rserver, rresource = split(input_jid);
+ assert_equal(expected_node, rnode, "split("..tostring(input_jid)..") failed");
+ assert_equal(expected_server, rserver, "split("..tostring(input_jid)..") failed");
+ assert_equal(expected_resource, rresource, "split("..tostring(input_jid)..") failed");
end
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(nil, nil, nil , nil );
end