-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathezmq_test.lua
57 lines (44 loc) · 1.53 KB
/
ezmq_test.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
require("ezmq")
function testParseSpellLine()
local o = parseSpellLine("Ward of Valiance/MinMana|50/CheckFor|Hand of Conviction")
assert(o.Name == "Ward of Valiance")
assert(o.MinMana == 50)
assert(o.CheckFor == "Hand of Conviction")
o = parseSpellLine("Ancient: Nova Strike/GoM/NoAggro")
assert(o.Name == "Ancient: Nova Strike")
assert(o.GoM == true)
assert(o.NoAggro == true)
o = parseSpellLine("Class|DRU/Everspring Jerkin of the Tangled Briars")
assert(o.Name == "Everspring Jerkin of the Tangled Briars")
assert(o.Class == "DRU")
o = parseSpellLine("Balance of Discord/MaxTries|3/MinMana|10")
assert(o.Name == "Balance of Discord")
assert(o.MaxTries == 3)
assert(o.MinMana == 10)
end
function testParseFilterLine()
local o = parseFilterLine("/only|WAR")
print("dumped filterConfig: " .. dump(o))
print("hex: ".. hex_dump(o.Only))
assert(o.Only == "WAR")
assert(o.Not == nil)
end
function test_split_str()
local o = split_str("Hello,World", ",")
assert(o[1] == "Hello")
assert(o[2] == "World")
o = split_str("Ward of Valiance/MinMana|50/CheckFor|Hand of Conviction", "/")
assert(o[1] == "Ward of Valiance")
assert(o[2] == "MinMana|50")
assert(o[3] == "CheckFor|Hand of Conviction")
end
function test_strip_dannet_peer()
local o = strip_dannet_peer("server_name")
assert(o == "Name")
o = strip_dannet_peer("name")
assert(o == "Name")
end
testParseSpellLine()
testParseFilterLine()
test_split_str()
test_strip_dannet_peer()