Comparison

tests/test_util_jid.lua @ 239:6f4e9911c7d1

Fix jid.split test function
author Matthew Wild <mwild1@gmail.com>
date Sun, 09 Nov 2008 23:58:19 +0000
parent 28:4a238233f278
child 240:c48dbfa6b1a6
comparison
equal deleted inserted replaced
238:a8e0d0faade3 239:6f4e9911c7d1
1 1
2 function split(split) 2 function split(split)
3 function test(jid, node, server, resource) 3 function test(jid, node, server, resource)
4 local rnode, rserver, rresource = split(jid); 4 local rnode, rserver, rresource = split(jid);
5 assert_equal(node, rnode, "split("..jid..") failed"); 5 assert_equal(node, rnode, "split("..tostring(jid)..") failed");
6 assert_equal(server, rserver, "split("..jid..") failed"); 6 assert_equal(server, rserver, "split("..tostring(jid)..") failed");
7 assert_equal(resource, rresource, "split("..jid..") failed"); 7 assert_equal(resource, rresource, "split("..tostring(jid)..") failed");
8 end 8 end
9 test("node@server", "node", "server", nil ); 9 test("node@server", "node", "server", nil );
10 test("node@server/resource", "node", "server", "resource" ); 10 test("node@server/resource", "node", "server", "resource" );
11 test("server", nil, "server", nil ); 11 test("server", nil, "server", nil );
12 test("server/resource", nil, "server", "resource" ); 12 test("server/resource", nil, "server", "resource" );
13 test(nil, nil, nil , nil );
13 end 14 end