Skip to content

Commit

Permalink
Added new tests to verify that versions with underscores are meaningf…
Browse files Browse the repository at this point in the history
…ully parsed and compared (#76)
  • Loading branch information
mcasperson authored Nov 11, 2024
1 parent 8475fba commit 4d3b9e5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions source/Octopus.Versioning.Tests/Octopus/OctopusVersionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1083,5 +1083,19 @@ public static string RandomString(int length)
.Select(s => s[Random.Next(s.Length)])
.ToArray());
}

[Test]
[TestCase("1_2_3", "1_2_4")]
[TestCase("01_2_3", "1_2_4")]
[TestCase("1_02_3", "1_2_4")]
[TestCase("1_02_03", "1_2_4")]
[TestCase("1_2_03", "1_2_4")]
public void TestUnderscores(string version, string version2)
{
OctopusVersionParser.TryParse(version, out var octoVersion);
OctopusVersionParser.TryParse(version2, out var octoVersion2);

Assert.Greater(octoVersion2, octoVersion);
}
}
}

0 comments on commit 4d3b9e5

Please sign in to comment.