Annotate

tests/test_util_jid.lua @ 225:bbbd169b326b

Just committing this warning, because I want to know if the problem really affects us
author Matthew Wild <mwild1@gmail.com>
date Sat, 08 Nov 2008 20:39:08 +0000
parent 28:4a238233f278
child 239:6f4e9911c7d1
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)
4a238233f278 Adding initial unit testing scripts
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3 function test(jid, node, server, resource)
4a238233f278 Adding initial unit testing scripts
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
4 local rnode, rserver, rresource = split(jid);
4a238233f278 Adding initial unit testing scripts
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5 assert_equal(node, rnode, "split("..jid..") failed");
4a238233f278 Adding initial unit testing scripts
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
6 assert_equal(server, rserver, "split("..jid..") failed");
4a238233f278 Adding initial unit testing scripts
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
7 assert_equal(resource, rresource, "split("..jid..") failed");
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" );
4a238233f278 Adding initial unit testing scripts
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
13 end