Skip to content

Commit 637d703

Browse files
committed
Update NextVersionCalculatorTests.cs
1 parent e705d37 commit 637d703

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
@@ -117,6 +117,36 @@ public void PreReleaseTagCanUseBranchName()
117117
fixture.AssertFullSemver("1.0.0-foo.1+2", config);
118118
}
119119

120+
[Test]
121+
public void PreReleaseTagCanUseBranchNameMainline()
122+
{
123+
var config = new Config
124+
{
125+
VersioningMode = VersioningMode.Mainline,
126+
NextVersion = "1.0.0",
127+
Branches = new Dictionary<string, BranchConfig>
128+
{
129+
{
130+
"custom", new BranchConfig
131+
{
132+
Regex = "custom/",
133+
Tag = "useBranchName",
134+
SourceBranches = new HashSet<string>()
135+
}
136+
}
137+
}
138+
};
139+
140+
using var fixture = new EmptyRepositoryFixture();
141+
fixture.MakeACommit();
142+
fixture.BranchTo("develop");
143+
fixture.MakeACommit();
144+
fixture.BranchTo("custom/foo");
145+
fixture.MakeACommit();
146+
147+
fixture.AssertFullSemver("1.0.0-foo.1.2", config);
148+
}
149+
120150
[Test]
121151
public void PreReleaseTagCanUseBranchNameVariable()
122152
{

0 commit comments

Comments
 (0)