Mercurial > prosody-hg
comparison tests/test_util_jid.lua @ 7473:a558fef9d018
test_util_jid: make function test() local [luacheck]
| author | Anton Shestakov <av6@dwimlabs.net> |
|---|---|
| date | Sat, 09 Jul 2016 00:56:32 +0800 |
| parents | 1859e07ae082 |
| children |
comparison
equal
deleted
inserted
replaced
| 7472:8965ad0aed2c | 7473:a558fef9d018 |
|---|---|
| 17 assert_equal(join("a", nil, "c"), nil, "invalid JID is nil"); | 17 assert_equal(join("a", nil, "c"), nil, "invalid JID is nil"); |
| 18 end | 18 end |
| 19 | 19 |
| 20 | 20 |
| 21 function split(split) | 21 function split(split) |
| 22 function test(input_jid, expected_node, expected_server, expected_resource) | 22 local function test(input_jid, expected_node, expected_server, expected_resource) |
| 23 local rnode, rserver, rresource = split(input_jid); | 23 local rnode, rserver, rresource = split(input_jid); |
| 24 assert_equal(expected_node, rnode, "split("..tostring(input_jid)..") failed"); | 24 assert_equal(expected_node, rnode, "split("..tostring(input_jid)..") failed"); |
| 25 assert_equal(expected_server, rserver, "split("..tostring(input_jid)..") failed"); | 25 assert_equal(expected_server, rserver, "split("..tostring(input_jid)..") failed"); |
| 26 assert_equal(expected_resource, rresource, "split("..tostring(input_jid)..") failed"); | 26 assert_equal(expected_resource, rresource, "split("..tostring(input_jid)..") failed"); |
| 27 end | 27 end |
