From 31f0c002166112bad1aa24cf0f7dc02d0c1721c8 Mon Sep 17 00:00:00 2001 From: Michael Ferguson Date: Mon, 8 Jul 2024 13:50:26 -0400 Subject: [PATCH] Add tighter assertion per review, fix formatting --- Signed-off-by: Michael Ferguson --- tools/chpl-language-server/test/diagnostics.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/chpl-language-server/test/diagnostics.py b/tools/chpl-language-server/test/diagnostics.py index 81d14197c053..7bcfc91a13a2 100644 --- a/tools/chpl-language-server/test/diagnostics.py +++ b/tools/chpl-language-server/test/diagnostics.py @@ -53,17 +53,17 @@ async def test_incorrect_cross_file_diagnostics(client: LanguageClient): async with source_files(client, A=fileA, B=fileB) as docs: await save_file(client, docs("B"), docs("A")) assert len(client.diagnostics[docs("A").uri]) == 0 - assert len(client.diagnostics[docs("B").uri]) >= 1 + assert len(client.diagnostics[docs("B").uri]) == 2 # check if the expected warnings are present foundImplicitModule = False foundSameName = False for d in client.diagnostics[docs("B").uri]: - if 'ImplicitFileModule' in d.message: + if "ImplicitFileModule" in d.message: # Warning: [ImplicitFileModule]: an implicit module named 'B' # is being introduced to contain file-scope code foundImplicitModule = True - if 'ImplicitModuleSameName' in d.message: + if "ImplicitModuleSameName" in d.message: # Warning: [ImplicitModuleSameName]: module 'B' has # the same name as the implicit file module foundSameName = True