aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_util_jid.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-08-10 14:07:03 +0100
committerMatthew Wild <mwild1@gmail.com>2010-08-10 14:07:03 +0100
commitefff82cd9424a78012d68f4c70427eeeda1e50eb (patch)
tree67270afc0bc87191fc4afea5ca3e5031852275dc /tests/test_util_jid.lua
parent3deb503477daea5303b5d002bd82401be1a277f4 (diff)
downloadprosody-efff82cd9424a78012d68f4c70427eeeda1e50eb.tar.gz
prosody-efff82cd9424a78012d68f4c70427eeeda1e50eb.zip
tests/test_util_jid.lua: Better formatting, comments, and stop giving 5 arguments to a 4-argument function (thanks Asterix :) )
Diffstat (limited to 'tests/test_util_jid.lua')
-rw-r--r--tests/test_util_jid.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/test_util_jid.lua b/tests/test_util_jid.lua
index e91585bd..ac17f253 100644
--- a/tests/test_util_jid.lua
+++ b/tests/test_util_jid.lua
@@ -25,15 +25,18 @@ function split(split)
assert_equal(expected_server, rserver, "split("..tostring(input_jid)..") failed");
assert_equal(expected_resource, rresource, "split("..tostring(input_jid)..") failed");
end
+
+ -- 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(nil, nil, nil , nil );
- test("node@/server", nil, nil, nil , nil );
- test("@server", nil, nil, nil , nil );
- test("@server/resource",nil,nil,nil, nil );
+ -- 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);
end
function bare(bare)