Skip to content

Commit

Permalink
test: cover case-sensitive comparison (#124)
Browse files Browse the repository at this point in the history
Co-authored-by: Raphael Strotz <[email protected]>
  • Loading branch information
Xzelsius and Xzelsius authored Nov 7, 2024
1 parent 4437ccb commit 2732f1f
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions test/Ayaka.Nuke.Tests/PublicApi/IgnoreCaseWhenPossibleComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void Does_sort_lines()
"Ayaka.Nuke.DotNet.IHaveDotNetPackTarget",
"Ayaka.Nuke.DotNet.ICanDotNetBuild.DotNetBuildSettingsBase.get -> Nuke.Common.Tooling.Configure<Nuke.Common.Tools.DotNet.DotNetBuildSettings!>!",
"Ayaka.Nuke.DotNet.ICanDotNetBuild",
"ayaka.nuke.extensions",
"Ayaka.Nuke.Extensions",
"Ayaka.Nuke.DotNet.ICanDotNetBuild.DotNetBuildSettings.get -> Nuke.Common.Tooling.Configure<Nuke.Common.Tools.DotNet.DotNetBuildSettings!>!"
];

Expand All @@ -30,7 +30,30 @@ public void Does_sort_lines()
"Ayaka.Nuke.DotNet.ICanDotNetBuild.DotNetBuildSettings.get -> Nuke.Common.Tooling.Configure<Nuke.Common.Tools.DotNet.DotNetBuildSettings!>!",
"Ayaka.Nuke.DotNet.ICanDotNetBuild.DotNetBuildSettingsBase.get -> Nuke.Common.Tooling.Configure<Nuke.Common.Tools.DotNet.DotNetBuildSettings!>!",
"Ayaka.Nuke.DotNet.IHaveDotNetPackTarget",
"ayaka.nuke.extensions"
"Ayaka.Nuke.Extensions"
],
o => o.WithStrictOrdering());
}

[Fact]
public void Does_fallback_to_case_sensitive()
{
List<string> lines =
[
"ayaka.nuke.extensions",
"Ayaka.Nuke.DotNet.ICanDotNetBuild",
"Ayaka.Nuke.Extensions"
];

lines.Sort(IgnoreCaseWhenPossibleComparer.Instance);

lines
.Should()
.BeEquivalentTo(
[
"Ayaka.Nuke.DotNet.ICanDotNetBuild",
"Ayaka.Nuke.Extensions",
"ayaka.nuke.extensions",
],
o => o.WithStrictOrdering());
}
Expand Down

0 comments on commit 2732f1f

Please sign in to comment.