Skip to content

Commit

Permalink
Test with legacy AST too
Browse files Browse the repository at this point in the history
  • Loading branch information
montyly committed Mar 10, 2023
1 parent 76d8321 commit 7aba140
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ def test_contract_comments() -> None:

assert contract.comments == comments

# Test with legacy AST
comments = "@title Test Contract\n@dev Test comment"
solc_select.switch_global_version("0.5.16", always_install=True)
slither = Slither("./tests/custom_comments/contract_comment.sol", solc_force_legacy_json=True)
compilation_unit = slither.compilation_units[0]
contract = compilation_unit.get_contract_from_name("A")[0]

assert contract.comments == comments


def test_using_for_top_level_same_name() -> None:
solc_select.switch_global_version("0.8.15", always_install=True)
Expand Down

0 comments on commit 7aba140

Please sign in to comment.