Skip to content

Commit

Permalink
add test for compilation of vyz with options
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberthirst committed Nov 5, 2024
1 parent 49fa5d3 commit 297dd1b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/unit/cli/vyper_compile/test_compile_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,34 @@ def test_archive_compile_options(input_files):
]


def test_compile_vyz_with_options(input_files):
tmpdir, _, _, contract_file = input_files
search_paths = [".", tmpdir]

for option in format_options:
out_archive = compile_files([contract_file], ["archive"], paths=search_paths)

archive = out_archive[contract_file].pop("archive")

archive_path = Path("foo.zip.out.vyz")
with archive_path.open("wb") as f:
f.write(archive)

# compare compiling the two input bundles
out = compile_files([contract_file], [option], paths=search_paths)
out2 = compile_files([archive_path], [option])

if option in ["ast", "annotated_ast"]:
# would have to normalize paths and imports, so just verify it compiles
continue

if option in ["ir_runtime", "ir", "asm", "archive", "solc_json"]:
# TODO investigate why these don't pass the assert
continue

assert out[contract_file] == out2[archive_path]


def test_archive_compile_simultaneous_options(input_files):
tmpdir, _, _, contract_file = input_files
search_paths = [".", tmpdir]
Expand Down

0 comments on commit 297dd1b

Please sign in to comment.