Skip to content

Commit 122fbc6

Browse files
Adds include-paths-nested test case.
1 parent b6ba432 commit 122fbc6

File tree

5 files changed

+47
-0
lines changed

5 files changed

+47
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// SPDX-License-Identifier: UNLICENSED
2+
pragma solidity >=0.8.0;
3+
4+
contract C
5+
{
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// SPDX-License-Identifier: UNLICENSED
2+
pragma solidity >=0.8.0;
3+
4+
contract B
5+
{
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// SPDX-License-Identifier: UNLICENSED
2+
pragma solidity >=0.8.0;
3+
4+
contract A
5+
{
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// SPDX-License-Identifier: UNLICENSED
2+
pragma solidity >=0.8.0;
3+
4+
contract RootContract
5+
{
6+
}

test/lsp.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,29 @@ def test_analyze_all_project_files1(self, solc: JsonRpcProcess) -> None:
13601360
self.expect_equal(report['uri'], self.get_test_file_uri('E', SUBDIR), "Correct file URI")
13611361
self.expect_equal(len(report['diagnostics']), 0, "no diagnostics")
13621362

1363+
def test_analyze_all_project_files2(self, solc: JsonRpcProcess) -> None:
1364+
"""
1365+
Same as first test on that matter but with deeper nesting levels.
1366+
"""
1367+
SUBDIR = 'include-paths-nested'
1368+
EXPECTED_FILES = [
1369+
"A/B/C/foo",
1370+
"A/B/foo",
1371+
"A/foo",
1372+
"foo",
1373+
]
1374+
EXPECTED_URIS = [self.get_test_file_uri(x, SUBDIR) for x in EXPECTED_FILES]
1375+
self.setup_lsp(
1376+
solc,
1377+
file_load_strategy=FileLoadStrategy.ProjectDirectory,
1378+
project_root_subdir=SUBDIR
1379+
)
1380+
published_diagnostics = self.wait_for_diagnostics(solc)
1381+
self.expect_equal(len(published_diagnostics), len(EXPECTED_FILES), "Test number of files analyzed.")
1382+
for report in published_diagnostics:
1383+
self.expect_true(report['uri'] in EXPECTED_URIS, "Correct file URI")
1384+
self.expect_equal(len(report['diagnostics']), 0, "no diagnostics")
1385+
13631386
def test_publish_diagnostics_errors_multiline(self, solc: JsonRpcProcess) -> None:
13641387
self.setup_lsp(solc)
13651388
TEST_NAME = 'publish_diagnostics_3'

0 commit comments

Comments
 (0)