Software /
code /
prosody
Comparison
tests/test_util_jid.lua @ 28:4a238233f278
Adding initial unit testing scripts
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 27 Sep 2008 19:18:05 +0100 |
child | 239:6f4e9911c7d1 |
comparison
equal
deleted
inserted
replaced
27:859b316e2fb0 | 28:4a238233f278 |
---|---|
1 | |
2 function split(split) | |
3 function test(jid, node, server, resource) | |
4 local rnode, rserver, rresource = split(jid); | |
5 assert_equal(node, rnode, "split("..jid..") failed"); | |
6 assert_equal(server, rserver, "split("..jid..") failed"); | |
7 assert_equal(resource, rresource, "split("..jid..") failed"); | |
8 end | |
9 test("node@server", "node", "server", nil ); | |
10 test("node@server/resource", "node", "server", "resource" ); | |
11 test("server", nil, "server", nil ); | |
12 test("server/resource", nil, "server", "resource" ); | |
13 end |