From 0c0140fa2d272dd51efb80753ba7c226318a457c Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 31 Aug 2010 00:28:49 +0100 Subject: tests/test_util_jid.lua: Add more tests for JID splitting --- tests/test_util_jid.lua | 9 ++++++--- 1 file 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) -- cgit v1.2.3