tests/test_util_jid.lua: Better formatting, comments, and stop giving 5 arguments...
authorMatthew Wild <mwild1@gmail.com>
Tue, 10 Aug 2010 13:07:03 +0000 (14:07 +0100)
committerMatthew Wild <mwild1@gmail.com>
Tue, 10 Aug 2010 13:07:03 +0000 (14:07 +0100)
tests/test_util_jid.lua

index e91585bd05b96ffa68ee9c728d838dcedbb7171d..ac17f25354f7889029e4c2390cc188bf3557fd29 100644 (file)
@@ -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)