def actions(cls, test): yield fun.matchclass(arkham.GameplayAction_Stay) yield fun.take_first() yield fun.matchclass(arkham.GameplayAction_Fight) yield fun.matchclass(arkham.GameplayAction_Multiple) yield fun.matchclass(arkham.GameplayAction_IncurDamage) assert len(test.inv.trophies()) == 5 raise tester.EndTest(True)
def actions (cls, test): yield fun.matchclass (arkham.GameplayAction_Stay) yield fun.take_first () yield fun.matchclass (arkham.GameplayAction_Fight) yield fun.matchclass (arkham.GameplayAction_Multiple) yield fun.matchclass (arkham.GameplayAction_IncurDamage) assert len (test.inv.trophies ()) == 5 raise tester.EndTest (True)
def test6 (): x = fun.Function (object) @x.match (fun.any) def do (i): return 1 @x.match (fun.take_first (fun.val == 2)) def do (i): return 2 assert x (0) == 1 assert x (0) == 1 assert x (1) == 1 assert x (1) == 1 assert x (2) == 2 assert x (2) == 1 assert x (3) == 1 assert x (3) == 1
def test6(): x = fun.Function(object) @x.match(fun.any) def do(i): return 1 @x.match(fun.take_first(fun.val == 2)) def do(i): return 2 assert x(0) == 1 assert x(0) == 1 assert x(1) == 1 assert x(1) == 1 assert x(2) == 2 assert x(2) == 1 assert x(3) == 1 assert x(3) == 1