diff --git a/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs index 81f5f6b038..2f688efba2 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs @@ -406,4 +406,36 @@ public void TrackMergeMessageShouldBeConsideredOnTheMainBranch(bool trackMergeMe // ✅ succeeds as expected fixture.AssertFullSemver(expectedSemanticVersion, configuration); } + + [Test] + public void Bug1255() + { + var config = new Config + { + NextVersion = "5.0", + Branches = + { + { + "master", new BranchConfig + { + Regex = "master", + Tag = "beta", + Increment = IncrementStrategy.Patch, + VersioningMode = VersioningMode.ContinuousDeployment + } + } + } + }; + using (var fixture = new EmptyRepositoryFixture()) + { + fixture.Repository.MakeACommit(); + fixture.AssertFullSemver(config, "5.0.0-beta.0"); // why not "5.0.0-beta.1"? + fixture.Repository.MakeACommit(); + fixture.AssertFullSemver(config, "5.0.0-beta.1"); + fixture.Repository.MakeATaggedCommit("v5.0.0-rc.1"); + fixture.AssertFullSemver(config, "5.0.0-rc.1"); + fixture.Repository.MakeACommit(); + fixture.AssertFullSemver(config, "5.0.1-beta.1"); // test fails here, it generates "5.0.0-beta.1" which is not unique and lower than "5.0.0-rc.1" + } + } }