1 2 3 4 5 6 7 8 9 10 11 12
from infini.matcher import matcher, MatcherEvent def test(): event = MatcherEvent("rule.example_handler", string="测试") try: result = matcher.run(event) assert result == "捕获到输入: 测试" except Exception as error: return error return []