Annotate

tests/test_util_jid.lua @ 240:c48dbfa6b1a6

Renamed some of the variables in jid.split test to make it clearer
author Matthew Wild <mwild1@gmail.com>
date Mon, 10 Nov 2008 00:00:46 +0000
parent 239:6f4e9911c7d1
child 366:5691edc7dd63
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28
4a238233f278 Adding initial unit testing scripts
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
1
4a238233f278 Adding initial unit testing scripts
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
2 function split(split)
240
c48dbfa6b1a6 Renamed some of the variables in jid.split test to make it clearer
Matthew Wild <mwild1@gmail.com>
parents: 239
diff changeset
3 function test(input_jid, expected_node, expected_server, expected_resource)
c48dbfa6b1a6 Renamed some of the variables in jid.split test to make it clearer
Matthew Wild <mwild1@gmail.com>
parents: 239
diff changeset
4 local rnode, rserver, rresource = split(input_jid);
c48dbfa6b1a6 Renamed some of the variables in jid.split test to make it clearer
Matthew Wild <mwild1@gmail.com>
parents: 239
diff changeset
5 assert_equal(expected_node, rnode, "split("..tostring(input_jid)..") failed");
c48dbfa6b1a6 Renamed some of the variables in jid.split test to make it clearer
Matthew Wild <mwild1@gmail.com>
parents: 239
diff changeset
6 assert_equal(expected_server, rserver, "split("..tostring(input_jid)..") failed");
c48dbfa6b1a6 Renamed some of the variables in jid.split test to make it clearer
Matthew Wild <mwild1@gmail.com>
parents: 239
diff changeset
7 assert_equal(expected_resource, rresource, "split("..tostring(input_jid)..") failed");
28
4a238233f278 Adding initial unit testing scripts
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
8 end
4a238233f278 Adding initial unit testing scripts
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
9 test("node@server", "node", "server", nil );
4a238233f278 Adding initial unit testing scripts
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
10 test("node@server/resource", "node", "server", "resource" );
4a238233f278 Adding initial unit testing scripts
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
11 test("server", nil, "server", nil );
4a238233f278 Adding initial unit testing scripts
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
12 test("server/resource", nil, "server", "resource" );
239
6f4e9911c7d1 Fix jid.split test function
Matthew Wild <mwild1@gmail.com>
parents: 28
diff changeset
13 test(nil, nil, nil , nil );
28
4a238233f278 Adding initial unit testing scripts
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
14 end