mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
lsp.py: Trigger fatal error when importing outside of test dir
This commit is contained in:
parent
59e054bb9b
commit
02dfeb5427
@ -536,6 +536,10 @@ class FileTestRunner:
|
|||||||
self.suite.open_file_and_wait_for_diagnostics(self.solc, self.test_name)
|
self.suite.open_file_and_wait_for_diagnostics(self.solc, self.test_name)
|
||||||
|
|
||||||
for diagnostics in published_diagnostics:
|
for diagnostics in published_diagnostics:
|
||||||
|
if not diagnostics["uri"].startswith(self.suite.project_root_uri + "/"):
|
||||||
|
raise Exception(
|
||||||
|
f"'{self.test_name}.sol' imported file outside of test directory: '{diagnostics['uri']}'"
|
||||||
|
)
|
||||||
self.open_tests.append(diagnostics["uri"].replace(self.suite.project_root_uri + "/", "")[:-len(".sol")])
|
self.open_tests.append(diagnostics["uri"].replace(self.suite.project_root_uri + "/", "")[:-len(".sol")])
|
||||||
|
|
||||||
self.suite.expect_equal(
|
self.suite.expect_equal(
|
||||||
@ -570,8 +574,7 @@ class FileTestRunner:
|
|||||||
marker=markers[expected_diagnostic.marker]
|
marker=markers[expected_diagnostic.marker]
|
||||||
)
|
)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception:
|
||||||
print(e)
|
|
||||||
self.close_all_open_files()
|
self.close_all_open_files()
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user