File

tests/test_util_jid.lua @ 166:d4ee015fcee4

Backed out changeset 4adc53e03b4d (garbage collection)
author Matthew Wild <mwild1@gmail.com>
date Fri, 24 Oct 2008 19:04:51 +0100
parent 28:4a238233f278
child 239:6f4e9911c7d1
line wrap: on
line source


function split(split)
	function test(jid, node, server, resource)
		local rnode, rserver, rresource = split(jid);
		assert_equal(node, rnode, "split("..jid..") failed");
		assert_equal(server, rserver, "split("..jid..") failed");
		assert_equal(resource, rresource, "split("..jid..") failed");
	end
	test("node@server", 		"node", "server", nil		);
	test("node@server/resource", 	"node", "server", "resource"	);
	test("server", 			nil, 	"server", nil		);
	test("server/resource", 	nil, 	"server", "resource"	);
end