Software /
code /
prosody
Annotate
tests/test_util_jid.lua @ 193:13ac34255c37
mod_roster fix
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sun, 02 Nov 2008 02:23:52 +0500 |
parent | 28:4a238233f278 |
child | 239:6f4e9911c7d1 |
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 |