From 4e018fedd25adcffe83832df06f5a09bd0d655c2 Mon Sep 17 00:00:00 2001 From: RF-Tar-Railt Date: Sat, 21 Sep 2024 20:16:15 +0800 Subject: [PATCH] :white_check_mark: add test --- tests/components_test.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/components_test.py b/tests/components_test.py index 807ccb0e..ad358b08 100644 --- a/tests/components_test.py +++ b/tests/components_test.py @@ -37,6 +37,14 @@ def operate(cls, interface: "Arparma"): assert com1.parse("comp1 --foo 1 --baz 2").matched assert com1.parse("comp1 --foo 2 --baz 1").matched is False + com1.behaviors.clear() + com1.behaviors.append(conflict("foo", "baz.qux", target_limiter=lambda x: x == 1)) + + assert com1.parse("comp1 --foo 1").matched + assert com1.parse("comp1 --baz 2").matched + assert com1.parse("comp1 --foo 1 --baz 2").matched + assert com1.parse("comp1 --foo 1 --baz 1").matched is False + com1_1 = Alconna( "comp1_1", Option("-1", dest="one"),