test(central-ui): remove vacuous tests for removed analyzer diagnostics
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.
This commit is contained in:
@@ -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<ScriptShape>()));
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user