Skip to content

Commit 14983e1

Browse files
committed
2 parents 04daeee + 592ca40 commit 14983e1

4 files changed

Lines changed: 14 additions & 3 deletions

File tree

src/DiffEngine.Tests/DefinitionsTest.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ static string GetOsSupport(OsSupport osSupport)
6565
return builder.ToString();
6666
}
6767

68+
[Test]
69+
public async Task ToolOrderMatchesEnumOrder()
70+
{
71+
var definitionsOrder = Definitions.Tools.Select(_ => _.Tool).ToList();
72+
var enumOrder = Enum.GetValues(typeof(DiffTool)).Cast<DiffTool>().ToList();
73+
await Assert.That(definitionsOrder).IsEquivalentTo(enumOrder);
74+
}
75+
6876
[Test]
6977
public void WriteDefaultOrder()
7078
{

src/DiffEngine/Definitions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ public static class Definitions
55
public static IReadOnlyCollection<Definition> Tools { get; }
66

77
static Definitions() =>
8+
// Order determines default tool priority. Keep in sync with the DiffTool enum.
89
Tools =
910
[
1011
Implementation.MsWordDiff(),

src/DiffEngine/DiffTool.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
namespace DiffEngine;
22

3+
// The order of this enum determines the default tool priority in DiffTools.Resolved.
4+
// Keep this order in sync with Definitions.Tools.
35
public enum DiffTool
46
{
7+
MsWordDiff,
8+
MsExcelDiff,
59
BeyondCompare,
610
P4Merge,
711
Kaleidoscope,
@@ -25,6 +29,4 @@ public enum DiffTool
2529
VisualStudioCode,
2630
VisualStudio,
2731
Cursor,
28-
MsWordDiff,
29-
MsExcelDiff
3032
}

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project>
33
<PropertyGroup>
44
<NoWarn>CS1591;CS0649;NU1608;NU1109</NoWarn>
5-
<Version>19.1.1</Version>
5+
<Version>19.1.2</Version>
66
<AssemblyVersion>1.0.0</AssemblyVersion>
77
<PackageTags>Testing, Snapshot, Diff, Compare</PackageTags>
88
<Description>Launches diff tools based on file extensions. Designed to be consumed by snapshot testing libraries.</Description>

0 commit comments

Comments
 (0)