From fdbe5b4fed22b81c6dc295b5e2c7e5ec9c36211e Mon Sep 17 00:00:00 2001 From: Jeff Walker Date: Tue, 8 Oct 2019 12:05:17 -0700 Subject: [PATCH] unit test for issue #1844, tests that the version is bumped after a prerelease tag when not doing so would put them out of order --- .../VersionBumpingScenarios.cs | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/GitVersionCore.Tests/IntegrationTests/VersionBumpingScenarios.cs b/src/GitVersionCore.Tests/IntegrationTests/VersionBumpingScenarios.cs index 943ea3028e..a94778b57f 100644 --- a/src/GitVersionCore.Tests/IntegrationTests/VersionBumpingScenarios.cs +++ b/src/GitVersionCore.Tests/IntegrationTests/VersionBumpingScenarios.cs @@ -1,7 +1,8 @@ -using System.Collections.Generic; +using System.Collections.Generic; using GitTools.Testing; -using NUnit.Framework; using GitVersion.Configuration; +using GitVersion.VersioningModes; +using NUnit.Framework; namespace GitVersionCore.Tests.IntegrationTests { @@ -34,6 +35,33 @@ public void AppliedPrereleaseTagCausesBump() } } + [Test] + public void AppliedPrereleaseTagAfterBranchTagCausesVersionBump() + { + var configuration = new Config + { + Branches = + { + { + "master", new BranchConfig + { + Tag = "pre", + SourceBranches = new List(), + VersioningMode = VersioningMode.ContinuousDeployment, + } + } + } + }; + using (var fixture = new EmptyRepositoryFixture()) + { + fixture.Repository.MakeACommit(); + fixture.Repository.MakeATaggedCommit("1.0.0-rc"); + fixture.Repository.MakeACommit(); + + fixture.AssertFullSemver(configuration, "1.0.1-pre.1"); + } + } + [Test] public void CanUseCommitMessagesToBumpVersion() {