tests/test_util_jid.lua: Better formatting, comments, and stop giving 5 arguments to a 4-argument function (thanks Asterix :) )
authorMatthew Wild <mwild1@gmail.com>
Tue, 10 Aug 2010 14:07:03 +0100
changeset 3451 6402a9defcdc
parent 3450 4bd78a5fee75
child 3452 2d1a5d8893c2
tests/test_util_jid.lua: Better formatting, comments, and stop giving 5 arguments to a 4-argument function (thanks Asterix :) )
tests/test_util_jid.lua
--- a/tests/test_util_jid.lua	Sat Aug 07 19:00:04 2010 +0100
+++ b/tests/test_util_jid.lua	Tue Aug 10 14:07:03 2010 +0100
@@ -25,15 +25,18 @@
 		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)