Changeset

3479:f68198c2f68f

tests/test_util_jid.lua: Add more tests for JID splitting
author Matthew Wild <mwild1@gmail.com>
date Tue, 31 Aug 2010 00:28:49 +0100
parents 3478:4621c92d2368
children 3480:97831dfe7f72
files tests/test_util_jid.lua
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test_util_jid.lua	Mon Aug 30 04:55:12 2010 +0100
+++ b/tests/test_util_jid.lua	Tue Aug 31 00:28:49 2010 +0100
@@ -28,15 +28,18 @@
 
 	-- 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)