Skip to content

Commit 8f0571e

Browse files
committed
Update NextVersionCalculatorTests.cs
Test merging int master with next-version
1 parent 6cb755b commit 8f0571e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/GitVersionCore.Tests/VersionCalculation/NextVersionCalculatorTests.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,36 @@ public void PreReleaseTagCanUseBranchNameMainline()
147147
fixture.AssertFullSemver("1.0.0-foo.2", config);
148148
}
149149

150+
[Test]
151+
public void MergeIntoMainline()
152+
{
153+
var config = new Config
154+
{
155+
VersioningMode = VersioningMode.Mainline,
156+
NextVersion = "1.0.0",
157+
Branches = new Dictionary<string, BranchConfig>
158+
{
159+
{
160+
"custom", new BranchConfig
161+
{
162+
Regex = "custom/",
163+
Tag = "useBranchName",
164+
SourceBranches = new HashSet<string>()
165+
}
166+
}
167+
}
168+
};
169+
170+
using var fixture = new EmptyRepositoryFixture();
171+
fixture.MakeACommit();
172+
fixture.BranchTo("foo");
173+
fixture.MakeACommit();
174+
fixture.Checkout("master");
175+
fixture.Merge("foo");
176+
177+
fixture.AssertFullSemver("1.0.0", config);
178+
}
179+
150180
[Test]
151181
public void PreReleaseTagCanUseBranchNameVariable()
152182
{

0 commit comments

Comments
 (0)