Software /
code /
prosody
Comparison
tests/test_core_s2smanager.lua @ 6054:7a5ddbaf758d
Merge 0.9->0.10
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 02 Apr 2014 17:41:38 +0100 |
parent | 5776:bd0ff8ae98a8 |
comparison
equal
deleted
inserted
replaced
6053:2f93a04564b2 | 6054:7a5ddbaf758d |
---|---|
1 -- Prosody IM | 1 -- Prosody IM |
2 -- Copyright (C) 2008-2010 Matthew Wild | 2 -- Copyright (C) 2008-2010 Matthew Wild |
3 -- Copyright (C) 2008-2010 Waqas Hussain | 3 -- Copyright (C) 2008-2010 Waqas Hussain |
4 -- | 4 -- |
5 -- This project is MIT/X11 licensed. Please see the | 5 -- This project is MIT/X11 licensed. Please see the |
6 -- COPYING file in the source package for more information. | 6 -- COPYING file in the source package for more information. |
7 -- | 7 -- |
8 | 8 |
9 env = { | |
10 prosody = { events = require "util.events".new() }; | |
11 }; | |
9 | 12 |
10 function compare_srv_priorities(csp) | 13 function compare_srv_priorities(csp) |
11 local r1 = { priority = 10, weight = 0 } | 14 local r1 = { priority = 10, weight = 0 } |
12 local r2 = { priority = 100, weight = 0 } | 15 local r2 = { priority = 100, weight = 0 } |
13 local r3 = { priority = 1000, weight = 2 } | 16 local r3 = { priority = 1000, weight = 2 } |
14 local r4 = { priority = 1000, weight = 2 } | 17 local r4 = { priority = 1000, weight = 2 } |
15 local r5 = { priority = 1000, weight = 5 } | 18 local r5 = { priority = 1000, weight = 5 } |
16 | 19 |
17 assert_equal(csp(r1, r1), false); | 20 assert_equal(csp(r1, r1), false); |
18 assert_equal(csp(r1, r2), true); | 21 assert_equal(csp(r1, r2), true); |
19 assert_equal(csp(r1, r3), true); | 22 assert_equal(csp(r1, r3), true); |
20 assert_equal(csp(r1, r4), true); | 23 assert_equal(csp(r1, r4), true); |
21 assert_equal(csp(r1, r5), true); | 24 assert_equal(csp(r1, r5), true); |