From fd1518f4f4a26187bfb1f94102a4efb5f069be96 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Sat, 16 May 2026 15:06:30 -0400 Subject: [PATCH] test(central-ui): remove vacuous tests for removed analyzer diagnostics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Six tests asserted DoesNotContain(SCADA004/SCADA005) or an empty InlayHints result — all pass for the wrong reason now that those diagnostics and the positional InlayHints were removed in the analyzer realignment. They also used the obsolete top-level CallScript syntax. Removed. --- .../ScriptAnalysisServiceTests.cs | 72 ------------------- 1 file changed, 72 deletions(-) diff --git a/tests/ScadaLink.CentralUI.Tests/ScriptAnalysis/ScriptAnalysisServiceTests.cs b/tests/ScadaLink.CentralUI.Tests/ScriptAnalysis/ScriptAnalysisServiceTests.cs index 95955b0..83ad758 100644 --- a/tests/ScadaLink.CentralUI.Tests/ScriptAnalysis/ScriptAnalysisServiceTests.cs +++ b/tests/ScadaLink.CentralUI.Tests/ScriptAnalysis/ScriptAnalysisServiceTests.cs @@ -122,35 +122,6 @@ public class ScriptAnalysisServiceTests Assert.DoesNotContain(resp.Markers, m => m.Code == "SCADA003"); } - [Fact] - public void ArgumentCountCorrect_NoMarker() - { - var siblings = new[] { Shape("Calc", Param("x"), Param("y")) }; - var resp = _svc.Diagnose(new DiagnoseRequest( - Code: "var r = CallScript(\"Calc\", 1, 2);", - SiblingScripts: siblings)); - Assert.DoesNotContain(resp.Markers, m => m.Code == "SCADA004"); - } - - [Fact] - public void OptionalParameter_AcceptsBothOmittedAndPresent() - { - var siblings = new[] - { - Shape("Calc", Param("x"), Param("y", required: false)) - }; - // Required only (1) — OK. - var with1 = _svc.Diagnose(new DiagnoseRequest( - Code: "var r = CallScript(\"Calc\", 1);", - SiblingScripts: siblings)); - Assert.DoesNotContain(with1.Markers, m => m.Code == "SCADA004"); - // Both passed (2) — OK. - var with2 = _svc.Diagnose(new DiagnoseRequest( - Code: "var r = CallScript(\"Calc\", 1, 2);", - SiblingScripts: siblings)); - Assert.DoesNotContain(with2.Markers, m => m.Code == "SCADA004"); - } - // ── Completions ─────────────────────────────────────────────────────── [Fact] @@ -298,49 +269,6 @@ public class ScriptAnalysisServiceTests Assert.Equal("", _svc.Format(new FormatRequest("")).Code); } - // ── Inlay hints ─────────────────────────────────────────────────────── - - [Fact] - public void InlayHints_OnUnknownSibling_Skipped() - { - var resp = _svc.InlayHints(new InlayHintsRequest( - Code: "var r = CallScript(\"NotKnown\", 1, 2);", - SiblingScripts: Array.Empty())); - Assert.Empty(resp.Hints); - } - - // ── Argument-type diagnostic (SCADA005) ─────────────────────────────── - - [Fact] - public void ArgumentType_FloatAcceptsInteger() - { - var siblings = new[] { Shape("Calc", Param("ratio", "Float")) }; - var resp = _svc.Diagnose(new DiagnoseRequest( - Code: "var r = CallScript(\"Calc\", 1);", - SiblingScripts: siblings)); - Assert.DoesNotContain(resp.Markers, m => m.Code == "SCADA005"); - } - - [Fact] - public void ArgumentType_ObjectAcceptsAnyLiteral() - { - var siblings = new[] { Shape("Log", Param("v", "Object")) }; - var resp = _svc.Diagnose(new DiagnoseRequest( - Code: "var r = CallScript(\"Log\", 1); CallScript(\"Log\", \"x\"); CallScript(\"Log\", true);", - SiblingScripts: siblings)); - Assert.DoesNotContain(resp.Markers, m => m.Code == "SCADA005"); - } - - [Fact] - public void ArgumentType_NonLiteralExpression_SkipsCheck() - { - var siblings = new[] { Shape("Calc", Param("n", "Integer")) }; - var resp = _svc.Diagnose(new DiagnoseRequest( - Code: "var x = \"hi\"; var r = CallScript(\"Calc\", x);", - SiblingScripts: siblings)); - Assert.DoesNotContain(resp.Markers, m => m.Code == "SCADA005"); - } - // ── Self / Children / Parent attribute completions ──────────────────── private static AttributeShape Attr(string name, string type = "String") => new(name, type);