tests/test_util_jid.lua: Add more tests for JID splitting

This commit is contained in:
Matthew Wild 2010-08-31 00:28:49 +01:00
parent e3718ed22e
commit 0c0140fa2d

View file

@ -28,15 +28,18 @@ function split(split)
-- Valid JIDs -- Valid JIDs
test("node@server", "node", "server", nil ); test("node@server", "node", "server", nil );
test("node@server/resource", "node", "server", "resource" ); test("node@server/resource", "node", "server", "resource" );
test("server", nil, "server", nil ); test("server", nil, "server", nil );
test("server/resource", nil, "server", "resource" ); 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 -- Always invalid JIDs
test(nil, nil, nil, nil); test(nil, nil, nil, nil);
test("node@/server", nil, nil, nil); test("node@/server", nil, nil, nil);
test("@server", nil, nil, nil); test("@server", nil, nil, nil);
test("@server/resource", nil, nil, nil); test("@server/resource", nil, nil, nil);
test("@/resource", nil, nil, nil);
end end
function bare(bare) function bare(bare)