From a778622136070d1b9f499c6a8364fc08cab46e1d Mon Sep 17 00:00:00 2001 From: David P Date: Wed, 12 Jul 2017 23:34:42 +0200 Subject: [PATCH] Failing test case for bug #1255 --- .../IntegrationTests/MasterScenarios.cs | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/GitVersionCore.Tests/IntegrationTests/MasterScenarios.cs b/src/GitVersionCore.Tests/IntegrationTests/MasterScenarios.cs index bc5f4dded1..995762dccc 100644 --- a/src/GitVersionCore.Tests/IntegrationTests/MasterScenarios.cs +++ b/src/GitVersionCore.Tests/IntegrationTests/MasterScenarios.cs @@ -231,4 +231,36 @@ public void AreTagsNotAdheringToTagPrefixIgnored() fixture.AssertFullSemver(config, "0.1.0+6"); //Fallback version + 6 commits since tag } } + + [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" + } + } } \ No newline at end of file