def test_apply_wildcard_match(): input_types = ['int', '+', '?'] output_type = 'int' type_rule = TypeRule(input_types, output_type) expression = ['int', '+', 'string'] assert type_rule.apply(expression) == output_type
def test_apply_no_match(): input_types = ['int', '-', 'int'] output_type = 'int' type_rule = TypeRule(input_types, output_type) expression = ['int', '+', 'int'] assert type_rule.apply(expression) is None