mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-16 11:42:45 +08:00
e9a81cd185
- 修复了翻译只替换一次参数(%src之类的)的bug - 添加了卡牌专属的清除后缀,现在cheat获得的牌自带信仰之力 - 补齐了neg判定相关的函数 - 添加multiple_targets,标记多目标牌 - 添加复原武将牌的描述 - 房间名带省略号 --------- Co-authored-by: notify <notify-ctrl@qq.com>
53 lines
2.1 KiB
Lua
53 lines
2.1 KiB
Lua
TestExppattern = {
|
|
testMatchExp = function()
|
|
local exp1 = Exppattern:Parse("slash,jink")
|
|
lu.assertTrue(exp1:matchExp("peack,jink"))
|
|
end,
|
|
|
|
testEasyMatchCard = function()
|
|
local exp1 = Exppattern:Parse("slash,jink")
|
|
local exp2 = Exppattern:Parse("peach,jink")
|
|
local slash = Fk:cloneCard("slash")
|
|
lu.assertTrue(exp1:match(slash))
|
|
lu.assertFalse(exp2:match(slash))
|
|
end,
|
|
|
|
testMatchWithType = function()
|
|
local exp3 = Exppattern:Parse(".|.|.|.|.|normal_trick")
|
|
lu.assertFalse(exp3:matchExp("slash,jink"))
|
|
lu.assertTrue(exp3:matchExp("peach,ex_nihilo"))
|
|
|
|
local basic = Exppattern:Parse(".|.|.|.|.|basic")
|
|
lu.assertFalse(basic:matchExp("nullification"))
|
|
lu.assertTrue(basic:matchExp("slash,vine"))
|
|
lu.assertTrue(Exppattern:Parse(".|.|.|.|.|armor"):matchExp("slash,vine"))
|
|
lu.assertTrue(Exppattern:Parse(".|.|.|.|.|trick"):matchExp("lightning"))
|
|
lu.assertFalse(Exppattern:Parse(".|.|.|.|.|delayed_trick"):matchExp("savage_assault"))
|
|
end,
|
|
|
|
testMatchNeg = function()
|
|
lu.assertError(function() Exppattern:Parse("^(a,|1)") end)
|
|
local not_nul = Exppattern:Parse("^nullification")
|
|
local not_slash_jink = Exppattern:Parse("^(slash,jink)")
|
|
local not_basic = Exppattern:Parse(".|.|.|.|.|^basic")
|
|
local not_black = Exppattern:Parse(".|.|^(spade,club)")
|
|
local slash_jink = Exppattern:Parse("slash,jink")
|
|
local no_slash_jink = Exppattern:Parse("^(slash,jink)|.|.|.|.|basic")
|
|
local slash = Fk:cloneCard("slash")
|
|
|
|
lu.assertFalse(not_nul:matchExp("nullification"))
|
|
lu.assertTrue(not_basic:matchExp("nullification"))
|
|
lu.assertFalse(not_slash_jink:matchExp("jink"))
|
|
lu.assertTrue(not_nul:match(slash))
|
|
lu.assertFalse(not_slash_jink:match(slash))
|
|
lu.assertFalse(not_basic:match(slash))
|
|
lu.assertTrue(not_nul:matchExp("peach"))
|
|
lu.assertFalse(not_basic:matchExp(no_slash_jink))
|
|
lu.assertTrue(not_slash_jink:matchExp(not_basic))
|
|
lu.assertFalse(slash_jink:matchExp(not_slash_jink))
|
|
lu.assertFalse(not_black:matchExp("slash|A~Q|spade"))
|
|
lu.assertTrue(not_black:matchExp("vine|10|^club"))
|
|
end,
|
|
|
|
}
|