File

tests/test_util_jid.lua @ 327:9439362caacc

Fixed s2s manager's send queue to not store recieved stanza objects (as these can chnage after the send call)
author Waqas Hussain <waqas20@gmail.com>
date Mon, 17 Nov 2008 18:53:13 +0500
parent 240:c48dbfa6b1a6
child 366:5691edc7dd63
line wrap: on
line source


function split(split)
	function test(input_jid, expected_node, expected_server, expected_resource)
		local rnode, rserver, rresource = split(input_jid);
		assert_equal(expected_node, rnode, "split("..tostring(input_jid)..") failed");
		assert_equal(expected_server, rserver, "split("..tostring(input_jid)..") failed");
		assert_equal(expected_resource, rresource, "split("..tostring(input_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"	);
	test(nil,			nil,	nil	, nil		);
end