Software /
code /
prosody
Comparison
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 |
comparison
equal
deleted
inserted
replaced
239:6f4e9911c7d1 | 240:c48dbfa6b1a6 |
---|---|
1 | 1 |
2 function split(split) | 2 function split(split) |
3 function test(jid, node, server, resource) | 3 function test(input_jid, expected_node, expected_server, expected_resource) |
4 local rnode, rserver, rresource = split(jid); | 4 local rnode, rserver, rresource = split(input_jid); |
5 assert_equal(node, rnode, "split("..tostring(jid)..") failed"); | 5 assert_equal(expected_node, rnode, "split("..tostring(input_jid)..") failed"); |
6 assert_equal(server, rserver, "split("..tostring(jid)..") failed"); | 6 assert_equal(expected_server, rserver, "split("..tostring(input_jid)..") failed"); |
7 assert_equal(resource, rresource, "split("..tostring(jid)..") failed"); | 7 assert_equal(expected_resource, rresource, "split("..tostring(input_jid)..") failed"); |
8 end | 8 end |
9 test("node@server", "node", "server", nil ); | 9 test("node@server", "node", "server", nil ); |
10 test("node@server/resource", "node", "server", "resource" ); | 10 test("node@server/resource", "node", "server", "resource" ); |
11 test("server", nil, "server", nil ); | 11 test("server", nil, "server", nil ); |
12 test("server/resource", nil, "server", "resource" ); | 12 test("server/resource", nil, "server", "resource" ); |