You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it("should create a diagnostic with an Error severity", function()
427
+
localoutput=[[
428
+
{"type":"Diagnostic","severity":"Error","code":"undefined_variable","message":"`vim` is not defined","primary_label":{"filename":"init.lua","span":{"start":0,"start_line":0,"start_column":0,"end":3,"end_line":0,"end_column":3},"message":""},"notes":[],"secondary_labels":[]}
429
+
]]
426
430
427
-
it("should create a diagnostic (quote is between backquotes)", function()
428
-
localoutput=[[init.lua:1:1: error[undefined_variable]: `vim` is not defined]]
429
-
localdiagnostic=parser(output, { content=file })
431
+
parser({ output=output }, done)
430
432
assert.same({
431
-
row="1",
432
-
col="1",
433
-
end_col=4,
434
-
severity=1,
435
-
code="undefined_variable",
436
-
message="`vim` is not defined",
437
-
}, diagnostic)
433
+
{
434
+
code="undefined_variable",
435
+
col=1,
436
+
end_col=4,
437
+
end_row=1,
438
+
row=1,
439
+
message="`vim` is not defined\n",
440
+
severity=1,
441
+
},
442
+
}, selene_diagnostics[1])
438
443
end)
439
-
it("should create a diagnostic (quote is not between backquotes)", function()
440
-
localoutput=
441
-
[[lua/default-config.lua:2:1: warning[unused_variable]: CACHE_PATH is defined, but never used]]
442
-
localdiagnostic=parser(output, { content=file })
444
+
445
+
it("should create a diagnostic", function()
446
+
localoutput=[[
447
+
{"type":"Diagnostic","severity":"Warning","code":"unused_variable","message":"CACHE_PATH is assigned a value, but never used","primary_label":{"filename":"lua/default-config.lua","span":{"start":1,"start_line":1,"start_column":0,"end":1,"end_line":1,"end_column":10},"message":""},"notes":[],"secondary_labels":[]}
448
+
]]
449
+
450
+
parser({ output=output }, done)
443
451
assert.same({
444
-
row="2",
445
-
col="1",
446
-
end_col=11,
447
-
severity=2,
448
-
code="unused_variable",
449
-
message="CACHE_PATH is defined, but never used",
450
-
}, diagnostic)
452
+
{
453
+
code="unused_variable",
454
+
row=2,
455
+
end_row=2,
456
+
col=1,
457
+
end_col=11,
458
+
message="CACHE_PATH is assigned a value, but never used\n",
459
+
severity=2,
460
+
},
461
+
}, selene_diagnostics[2])
462
+
end)
463
+
464
+
it("should not create a diagnostic for summary", function()
0 commit comments