-
Notifications
You must be signed in to change notification settings - Fork 979
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
tests/unit/core/test_data/inheritance_resolution_error/contract_with_duplicate_names.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import {ERC20 as ERC20_1} from "./import.sol"; | ||
contract ERC20 is ERC20_1 {} |
1 change: 1 addition & 0 deletions
1
tests/unit/core/test_data/inheritance_resolution_error/import.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
contract ERC20 {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from pathlib import Path | ||
import pytest | ||
|
||
|
||
from slither import Slither | ||
from slither.solc_parsing.slither_compilation_unit_solc import InheritanceResolutionError | ||
|
||
TEST_DATA_DIR = Path(__file__).resolve().parent / "test_data" | ||
INHERITANCE_ERROR_ROOT = Path(TEST_DATA_DIR, "inheritance_resolution_error") | ||
|
||
|
||
def test_inheritance_resolution_error(solc_binary_path) -> None: | ||
with pytest.raises(InheritanceResolutionError): | ||
solc_path = solc_binary_path("0.8.0") | ||
Slither( | ||
Path(INHERITANCE_ERROR_ROOT, "contract_with_duplicate_names.sol").as_posix(), | ||
solc=solc_path, | ||
) |