Skip to content

Commit

Permalink
remove repeated code
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Dec 13, 2024
1 parent a392898 commit e46ccb7
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions tests/functional/codegen/test_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,23 +901,29 @@ def foo(s: MyStruct) -> MyStruct:
assert "MOO" in out


def test_external_interface_names():
vyi_filenames = [
"test__test.vyi",
"test__t.vyi",
"t__test.vyi",
"t__t.vyi",
"t_t.vyi",
"test_test.vyi",
"t_test.vyi",
"test_t.vyi",
"_test_t__t_tt_.vyi",
"foo_bar_baz.vyi",
]


@pytest.mark.parametrize("vyi_filename", vyi_filenames)
def test_external_interface_names(vyi_filename):
code = """
@external
def foo():
...
"""

compile_code(code, contract_path="test__test.vyi", output_formats=["external_interface"])
compile_code(code, contract_path="test__t.vyi", output_formats=["external_interface"])
compile_code(code, contract_path="t__test.vyi", output_formats=["external_interface"])
compile_code(code, contract_path="t__t.vyi", output_formats=["external_interface"])
compile_code(code, contract_path="t_t.vyi", output_formats=["external_interface"])
compile_code(code, contract_path="test_test.vyi", output_formats=["external_interface"])
compile_code(code, contract_path="t_test.vyi", output_formats=["external_interface"])
compile_code(code, contract_path="test_t.vyi", output_formats=["external_interface"])
compile_code(code, contract_path="_test_t__t_tt_.vyi", output_formats=["external_interface"])
compile_code(code, contract_path="foo_bar_baz.vyi", output_formats=["external_interface"])
compile_code(code, contract_path=vyi_filename, output_formats=["external_interface"])


def test_external_interface_with_flag():
Expand Down

0 comments on commit e46ccb7

Please sign in to comment.