Skip to content

Commit 62529a4

Browse files
authored
Merge pull request #112 from derhally/master
Add support of ExcludeFromCodeCoverage attribute
2 parents 97e6f3e + c1916a9 commit 62529a4

File tree

6 files changed

+155
-69
lines changed

6 files changed

+155
-69
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ You can ignore a method or an entire class from code coverage by creating and ap
8989

9090
* ExcludeFromCoverage
9191
* ExcludeFromCoverageAttribute
92+
* ExcludeFromCodeCoverage
93+
* ExcludeFromCodeCoverageAttribute
9294

9395
Coverlet just uses the type name, so the attributes can be created under any namespace of your choosing.
9496

coverlet.sln

+42-40
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
21
Microsoft Visual Studio Solution File, Format Version 12.00
32
# Visual Studio 15
43
VisualStudioVersion = 15.0.26124.0
54
MinimumVisualStudioVersion = 15.0.26124.0
65
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E877EBA4-E78B-4F7D-A2D3-1E070FED04CD}"
76
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "coverlet.core", "src\coverlet.core\coverlet.core.csproj", "{31084026-D563-4B91-BE71-174C4270CCF4}"
7+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.core", "src\coverlet.core\coverlet.core.csproj", "{31084026-D563-4B91-BE71-174C4270CCF4}"
98
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "coverlet.msbuild.tasks", "src\coverlet.msbuild.tasks\coverlet.msbuild.tasks.csproj", "{FA73E423-9790-4F35-B018-3C4E3CA338BA}"
9+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.msbuild.tasks", "src\coverlet.msbuild.tasks\coverlet.msbuild.tasks.csproj", "{FA73E423-9790-4F35-B018-3C4E3CA338BA}"
1110
EndProject
1211
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{2FEBDE1B-83E3-445B-B9F8-5644B0E0E134}"
1312
EndProject
14-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "coverlet.core.tests", "test\coverlet.core.tests\coverlet.core.tests.csproj", "{E7637CC6-43F7-461A-A0BF-3C14562419BD}"
13+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.core.tests", "test\coverlet.core.tests\coverlet.core.tests.csproj", "{E7637CC6-43F7-461A-A0BF-3C14562419BD}"
1514
EndProject
16-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "coverlet.console", "src\coverlet.console\coverlet.console.csproj", "{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}"
15+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.console", "src\coverlet.console\coverlet.console.csproj", "{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}"
1716
EndProject
1817
Global
1918
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -24,63 +23,66 @@ Global
2423
Release|x64 = Release|x64
2524
Release|x86 = Release|x86
2625
EndGlobalSection
27-
GlobalSection(SolutionProperties) = preSolution
28-
HideSolutionNode = FALSE
29-
EndGlobalSection
3026
GlobalSection(ProjectConfigurationPlatforms) = postSolution
3127
{31084026-D563-4B91-BE71-174C4270CCF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3228
{31084026-D563-4B91-BE71-174C4270CCF4}.Debug|Any CPU.Build.0 = Debug|Any CPU
33-
{31084026-D563-4B91-BE71-174C4270CCF4}.Debug|x64.ActiveCfg = Debug|x64
34-
{31084026-D563-4B91-BE71-174C4270CCF4}.Debug|x64.Build.0 = Debug|x64
35-
{31084026-D563-4B91-BE71-174C4270CCF4}.Debug|x86.ActiveCfg = Debug|x86
36-
{31084026-D563-4B91-BE71-174C4270CCF4}.Debug|x86.Build.0 = Debug|x86
29+
{31084026-D563-4B91-BE71-174C4270CCF4}.Debug|x64.ActiveCfg = Debug|Any CPU
30+
{31084026-D563-4B91-BE71-174C4270CCF4}.Debug|x64.Build.0 = Debug|Any CPU
31+
{31084026-D563-4B91-BE71-174C4270CCF4}.Debug|x86.ActiveCfg = Debug|Any CPU
32+
{31084026-D563-4B91-BE71-174C4270CCF4}.Debug|x86.Build.0 = Debug|Any CPU
3733
{31084026-D563-4B91-BE71-174C4270CCF4}.Release|Any CPU.ActiveCfg = Release|Any CPU
3834
{31084026-D563-4B91-BE71-174C4270CCF4}.Release|Any CPU.Build.0 = Release|Any CPU
39-
{31084026-D563-4B91-BE71-174C4270CCF4}.Release|x64.ActiveCfg = Release|x64
40-
{31084026-D563-4B91-BE71-174C4270CCF4}.Release|x64.Build.0 = Release|x64
41-
{31084026-D563-4B91-BE71-174C4270CCF4}.Release|x86.ActiveCfg = Release|x86
42-
{31084026-D563-4B91-BE71-174C4270CCF4}.Release|x86.Build.0 = Release|x86
35+
{31084026-D563-4B91-BE71-174C4270CCF4}.Release|x64.ActiveCfg = Release|Any CPU
36+
{31084026-D563-4B91-BE71-174C4270CCF4}.Release|x64.Build.0 = Release|Any CPU
37+
{31084026-D563-4B91-BE71-174C4270CCF4}.Release|x86.ActiveCfg = Release|Any CPU
38+
{31084026-D563-4B91-BE71-174C4270CCF4}.Release|x86.Build.0 = Release|Any CPU
4339
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4440
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
45-
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Debug|x64.ActiveCfg = Debug|x64
46-
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Debug|x64.Build.0 = Debug|x64
47-
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Debug|x86.ActiveCfg = Debug|x86
48-
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Debug|x86.Build.0 = Debug|x86
41+
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Debug|x64.ActiveCfg = Debug|Any CPU
42+
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Debug|x64.Build.0 = Debug|Any CPU
43+
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Debug|x86.ActiveCfg = Debug|Any CPU
44+
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Debug|x86.Build.0 = Debug|Any CPU
4945
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
5046
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Release|Any CPU.Build.0 = Release|Any CPU
51-
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Release|x64.ActiveCfg = Release|x64
52-
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Release|x64.Build.0 = Release|x64
53-
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Release|x86.ActiveCfg = Release|x86
54-
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Release|x86.Build.0 = Release|x86
47+
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Release|x64.ActiveCfg = Release|Any CPU
48+
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Release|x64.Build.0 = Release|Any CPU
49+
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Release|x86.ActiveCfg = Release|Any CPU
50+
{FA73E423-9790-4F35-B018-3C4E3CA338BA}.Release|x86.Build.0 = Release|Any CPU
5551
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
5652
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
57-
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Debug|x64.ActiveCfg = Debug|x64
58-
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Debug|x64.Build.0 = Debug|x64
59-
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Debug|x86.ActiveCfg = Debug|x86
60-
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Debug|x86.Build.0 = Debug|x86
53+
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Debug|x64.ActiveCfg = Debug|Any CPU
54+
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Debug|x64.Build.0 = Debug|Any CPU
55+
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Debug|x86.ActiveCfg = Debug|Any CPU
56+
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Debug|x86.Build.0 = Debug|Any CPU
6157
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
6258
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Release|Any CPU.Build.0 = Release|Any CPU
63-
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Release|x64.ActiveCfg = Release|x64
64-
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Release|x64.Build.0 = Release|x64
65-
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Release|x86.ActiveCfg = Release|x86
66-
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Release|x86.Build.0 = Release|x86
59+
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Release|x64.ActiveCfg = Release|Any CPU
60+
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Release|x64.Build.0 = Release|Any CPU
61+
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Release|x86.ActiveCfg = Release|Any CPU
62+
{E7637CC6-43F7-461A-A0BF-3C14562419BD}.Release|x86.Build.0 = Release|Any CPU
6763
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6864
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Debug|Any CPU.Build.0 = Debug|Any CPU
69-
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Debug|x64.ActiveCfg = Debug|x64
70-
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Debug|x64.Build.0 = Debug|x64
71-
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Debug|x86.ActiveCfg = Debug|x86
72-
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Debug|x86.Build.0 = Debug|x86
65+
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Debug|x64.ActiveCfg = Debug|Any CPU
66+
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Debug|x64.Build.0 = Debug|Any CPU
67+
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Debug|x86.ActiveCfg = Debug|Any CPU
68+
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Debug|x86.Build.0 = Debug|Any CPU
7369
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Release|Any CPU.ActiveCfg = Release|Any CPU
7470
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Release|Any CPU.Build.0 = Release|Any CPU
75-
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Release|x64.ActiveCfg = Release|x64
76-
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Release|x64.Build.0 = Release|x64
77-
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Release|x86.ActiveCfg = Release|x86
78-
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Release|x86.Build.0 = Release|x86
71+
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Release|x64.ActiveCfg = Release|Any CPU
72+
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Release|x64.Build.0 = Release|Any CPU
73+
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Release|x86.ActiveCfg = Release|Any CPU
74+
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E}.Release|x86.Build.0 = Release|Any CPU
75+
EndGlobalSection
76+
GlobalSection(SolutionProperties) = preSolution
77+
HideSolutionNode = FALSE
7978
EndGlobalSection
8079
GlobalSection(NestedProjects) = preSolution
8180
{31084026-D563-4B91-BE71-174C4270CCF4} = {E877EBA4-E78B-4F7D-A2D3-1E070FED04CD}
8281
{FA73E423-9790-4F35-B018-3C4E3CA338BA} = {E877EBA4-E78B-4F7D-A2D3-1E070FED04CD}
8382
{E7637CC6-43F7-461A-A0BF-3C14562419BD} = {2FEBDE1B-83E3-445B-B9F8-5644B0E0E134}
8483
{F3DBE7C3-ABBB-4B8B-A6CB-A1D3D607163E} = {E877EBA4-E78B-4F7D-A2D3-1E070FED04CD}
8584
EndGlobalSection
85+
GlobalSection(ExtensibilityGlobals) = postSolution
86+
SolutionGuid = {9CA57C02-97B0-4C38-A027-EA61E8741F10}
87+
EndGlobalSection
8688
EndGlobal

src/coverlet.core/Instrumentation/Instrumenter.cs

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Diagnostics.CodeAnalysis;
34
using System.IO;
45
using System.Linq;
56
using System.Reflection;
@@ -269,7 +270,16 @@ private static void ReplaceExceptionHandlerBoundary(ExceptionHandler handler, In
269270

270271
private static bool IsExcludeAttribute(CustomAttribute customAttribute)
271272
{
272-
return customAttribute.AttributeType.Name == nameof(ExcludeFromCoverageAttribute) || customAttribute.AttributeType.Name == "ExcludeFromCoverage";
273+
var excludeAttributeNames = new[]
274+
{
275+
nameof(ExcludeFromCoverageAttribute),
276+
"ExcludeFromCoverage",
277+
nameof(ExcludeFromCodeCoverageAttribute),
278+
"ExcludeFromCodeCoverage"
279+
};
280+
281+
var attributeName = customAttribute.AttributeType.Name;
282+
return excludeAttributeNames.Any(a => a.Equals(attributeName));
273283
}
274284

275285
private static Mono.Cecil.Cil.MethodBody GetMethodBody(MethodDefinition method)
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,75 @@
11
using System;
22
using System.IO;
3-
3+
using System.Linq;
44
using Xunit;
55
using Coverlet.Core.Instrumentation;
6+
using Coverlet.Core.Samples.Tests;
67

78
namespace Coverlet.Core.Instrumentation.Tests
89
{
910
public class InstrumenterTests
1011
{
1112
[Fact]
1213
public void TestInstrument()
14+
{
15+
var instrumenterTest = CreateInstrumentor();
16+
17+
var result = instrumenterTest.Instrumenter.Instrument();
18+
19+
Assert.Equal(Path.GetFileNameWithoutExtension(instrumenterTest.Module), result.Module);
20+
Assert.Equal(instrumenterTest.Module, result.ModulePath);
21+
22+
instrumenterTest.Directory.Delete(true);
23+
}
24+
25+
[Theory]
26+
[InlineData(typeof(ClassExcludedByCodeAnalysisCodeCoverageAttr))]
27+
[InlineData(typeof(ClassExcludedByCoverletCodeCoverageAttr))]
28+
public void TestInstrument_ClassesWithExcludeAttributeAreExcluded(Type excludedType)
29+
{
30+
var instrumenterTest = CreateInstrumentor();
31+
var result = instrumenterTest.Instrumenter.Instrument();
32+
33+
var doc = result.Documents.FirstOrDefault(d => Path.GetFileName(d.Path) == "Samples.cs");
34+
Assert.NotNull(doc);
35+
36+
var found = doc.Lines.Any(l => l.Class == excludedType.FullName);
37+
Assert.False(found, "Class decorated with with exclude attribute should be excluded");
38+
39+
instrumenterTest.Directory.Delete(true);
40+
}
41+
42+
private InstrumenterTest CreateInstrumentor()
1343
{
1444
string module = GetType().Assembly.Location;
1545
string pdb = Path.Combine(Path.GetDirectoryName(module), Path.GetFileNameWithoutExtension(module) + ".pdb");
1646
string identifier = Guid.NewGuid().ToString();
1747

18-
var directory = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), identifier));
48+
DirectoryInfo directory = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), identifier));
1949

2050
File.Copy(module, Path.Combine(directory.FullName, Path.GetFileName(module)), true);
2151
File.Copy(pdb, Path.Combine(directory.FullName, Path.GetFileName(pdb)), true);
2252

2353
module = Path.Combine(directory.FullName, Path.GetFileName(module));
2454
Instrumenter instrumenter = new Instrumenter(module, identifier, Array.Empty<string>(), Array.Empty<string>());
25-
var result = instrumenter.Instrument();
55+
return new InstrumenterTest
56+
{
57+
Instrumenter = instrumenter,
58+
Module = module,
59+
Identifier = identifier,
60+
Directory = directory
61+
};
62+
}
63+
64+
class InstrumenterTest
65+
{
66+
public Instrumenter Instrumenter { get; set; }
67+
68+
public string Module { get; set; }
2669

27-
Assert.Equal(Path.GetFileNameWithoutExtension(module), result.Module);
28-
Assert.Equal(module, result.ModulePath);
70+
public string Identifier { get; set; }
2971

30-
directory.Delete(true);
72+
public DirectoryInfo Directory { get; set; }
3173
}
3274
}
3375
}

test/coverlet.core.tests/Samples/Samples.cs

+30
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
4+
using System.Diagnostics.CodeAnalysis;
45
using System.IO;
56
using System.Linq;
67
using System.Threading.Tasks;
8+
using Coverlet.Core.Attributes;
79

810
namespace Coverlet.Core.Samples.Tests
911
{
@@ -161,4 +163,32 @@ public IEnumerable<string> Fetch()
161163
yield return "two";
162164
}
163165
}
166+
167+
[ExcludeFromCoverage]
168+
public class ClassExcludedByCoverletCodeCoverageAttr
169+
{
170+
171+
public string Method(string input)
172+
{
173+
if(string.IsNullOrEmpty(input))
174+
throw new ArgumentException("Cannot be empty", nameof(input));
175+
176+
return input;
177+
}
178+
}
179+
180+
[ExcludeFromCodeCoverage]
181+
public class ClassExcludedByCodeAnalysisCodeCoverageAttr
182+
{
183+
184+
public string Method(string input)
185+
{
186+
if (string.IsNullOrEmpty(input))
187+
throw new ArgumentException("Cannot be empty", nameof(input));
188+
189+
return input;
190+
}
191+
}
192+
193+
164194
}

test/coverlet.core.tests/Symbols/CecilSymbolHelperTests.cs

+22-22
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public void GetBranchPoints_OneBranch()
3939
Assert.Equal(points[0].Offset, points[1].Offset);
4040
Assert.Equal(0, points[0].Path);
4141
Assert.Equal(1, points[1].Path);
42-
Assert.Equal(19, points[0].StartLine);
43-
Assert.Equal(19, points[1].StartLine);
42+
Assert.Equal(21, points[0].StartLine);
43+
Assert.Equal(21, points[1].StartLine);
4444
Assert.NotNull(points[1].Document);
4545
Assert.Equal(points[0].Document, points[1].Document);
4646
}
@@ -86,8 +86,8 @@ public void GetBranchPoints_TwoBranch()
8686
Assert.Equal(4, points.Count());
8787
Assert.Equal(points[0].Offset, points[1].Offset);
8888
Assert.Equal(points[2].Offset, points[3].Offset);
89-
Assert.Equal(25, points[0].StartLine);
90-
Assert.Equal(26, points[2].StartLine);
89+
Assert.Equal(27, points[0].StartLine);
90+
Assert.Equal(28, points[2].StartLine);
9191
}
9292

9393
[Fact]
@@ -104,8 +104,8 @@ public void GetBranchPoints_CompleteIf()
104104
Assert.NotNull(points);
105105
Assert.Equal(2, points.Count());
106106
Assert.Equal(points[0].Offset, points[1].Offset);
107-
Assert.Equal(32, points[0].StartLine);
108-
Assert.Equal(32, points[1].StartLine);
107+
Assert.Equal(34, points[0].StartLine);
108+
Assert.Equal(34, points[1].StartLine);
109109
}
110110

111111
[Fact]
@@ -125,10 +125,10 @@ public void GetBranchPoints_Switch()
125125
Assert.Equal(points[0].Offset, points[2].Offset);
126126
Assert.Equal(3, points[3].Path);
127127

128-
Assert.Equal(44, points[0].StartLine);
129-
Assert.Equal(44, points[1].StartLine);
130-
Assert.Equal(44, points[2].StartLine);
131-
Assert.Equal(44, points[3].StartLine);
128+
Assert.Equal(46, points[0].StartLine);
129+
Assert.Equal(46, points[1].StartLine);
130+
Assert.Equal(46, points[2].StartLine);
131+
Assert.Equal(46, points[3].StartLine);
132132
}
133133

134134
[Fact]
@@ -148,10 +148,10 @@ public void GetBranchPoints_SwitchWithDefault()
148148
Assert.Equal(points[0].Offset, points[2].Offset);
149149
Assert.Equal(3, points[3].Path);
150150

151-
Assert.Equal(58, points[0].StartLine);
152-
Assert.Equal(58, points[1].StartLine);
153-
Assert.Equal(58, points[2].StartLine);
154-
Assert.Equal(58, points[3].StartLine);
151+
Assert.Equal(60, points[0].StartLine);
152+
Assert.Equal(60, points[1].StartLine);
153+
Assert.Equal(60, points[2].StartLine);
154+
Assert.Equal(60, points[3].StartLine);
155155
}
156156

157157
[Fact]
@@ -171,10 +171,10 @@ public void GetBranchPoints_SwitchWithBreaks()
171171
Assert.Equal(points[0].Offset, points[2].Offset);
172172
Assert.Equal(3, points[3].Path);
173173

174-
Assert.Equal(74, points[0].StartLine);
175-
Assert.Equal(74, points[1].StartLine);
176-
Assert.Equal(74, points[2].StartLine);
177-
Assert.Equal(74, points[3].StartLine);
174+
Assert.Equal(76, points[0].StartLine);
175+
Assert.Equal(76, points[1].StartLine);
176+
Assert.Equal(76, points[2].StartLine);
177+
Assert.Equal(76, points[3].StartLine);
178178
}
179179

180180
[Fact]
@@ -195,10 +195,10 @@ public void GetBranchPoints_SwitchWithMultipleCases()
195195
Assert.Equal(points[0].Offset, points[3].Offset);
196196
Assert.Equal(3, points[3].Path);
197197

198-
Assert.Equal(92, points[0].StartLine);
199-
Assert.Equal(92, points[1].StartLine);
200-
Assert.Equal(92, points[2].StartLine);
201-
Assert.Equal(92, points[3].StartLine);
198+
Assert.Equal(94, points[0].StartLine);
199+
Assert.Equal(94, points[1].StartLine);
200+
Assert.Equal(94, points[2].StartLine);
201+
Assert.Equal(94, points[3].StartLine);
202202
}
203203

204204
[Fact]

0 commit comments

Comments
 (0)