Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use markup for compiler errors in tests
  • Loading branch information
RikkiGibson committed Jul 16, 2021
commit 7264d6240797e3bac8602f83e3b0019f052fdc82
Original file line number Diff line number Diff line change
Expand Up @@ -549,20 +549,18 @@ public class C

public enum MyEnum
{
Value1 = C.I
}",
DiagnosticResult.CompilerError("CS0133").WithSpan(9, 14, 9, 17).WithArguments("MyEnum.Value1"));
Value1 = {|CS0133:C.I|}
}");

await VerifyVB.VerifyAnalyzerAsync(@"
Public Module M
Public I As Integer = 1
End Module

Public Enum MyEnum
Value1 = M.I
Value1 = {|BC30059:M.I|}
End Enum
",
DiagnosticResult.CompilerError("BC30059").WithSpan(7, 14, 7, 17));
");
}

[Fact]
Expand All @@ -571,9 +569,8 @@ public async Task EnumMemberNullConstantValue_NoDiagnostic()
await VerifyCS.VerifyAnalyzerAsync(@"
public enum MyEnum
{
Value1 = null
}",
DiagnosticResult.CompilerError("CS0037").WithSpan(4, 14, 4, 18).WithArguments("int"));
Value1 = {|CS0037:null|}
}");

await VerifyVB.VerifyAnalyzerAsync(@"
Public Enum MyEnum
Expand Down