Skip to content

Commit 8f967df

Browse files
committed
Create a test for ALS config files with comments
1 parent 7eac173 commit 8f967df

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// Single line comment
3+
/* multi-line
4+
comment
5+
*/
6+
"projectFile": "non-root/p2.gpr"
7+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
project P2 is
2+
end P2;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""
2+
The goal of this test is to check that comments are supported in .als.json files
3+
4+
To test that, we create a non-root/p2.gpr project file and configure it in a .als.json
5+
with comments. We can determine if the config loading was successful (i.e. comments are
6+
supported) by querying for the current project.
7+
"""
8+
9+
from drivers.pylsp import URI, ALSLanguageClient, assertEqual, test
10+
11+
12+
@test()
13+
async def func(lsp: ALSLanguageClient) -> None:
14+
response = await lsp.getCurrentProject()
15+
assertEqual(response, URI("non-root/p2.gpr"))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
driver: pylsp

0 commit comments

Comments
 (0)