Skip to content

Commit 460ed85

Browse files
committed
Add path filter test with two-deep folder path
This repros #587
1 parent 8126d95 commit 460ed85

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/NerdBank.GitVersioning.Tests/VersionOracleTests.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,28 @@ public void GetVersionHeight_IncludeRootExcludeSome()
731731
Assert.Equal(2, this.GetVersionHeight(relativeDirectory));
732732
}
733733

734+
[Fact]
735+
public void GetVersion_PathFilterInTwoDeepSubDirAndVersionBump()
736+
{
737+
this.InitializeSourceControl();
738+
739+
const string relativeDirectory = "src\\lib";
740+
var versionOptions = new VersionOptions
741+
{
742+
Version = new SemanticVersion("1.1"),
743+
PathFilters = new FilterPath[]
744+
{
745+
new FilterPath(".", relativeDirectory),
746+
},
747+
};
748+
this.WriteVersionFile(versionOptions, relativeDirectory);
749+
Assert.Equal(1, this.GetVersionHeight(relativeDirectory));
750+
751+
versionOptions.Version = new SemanticVersion("1.2");
752+
this.WriteVersionFile(versionOptions, relativeDirectory);
753+
Assert.Equal(1, this.GetVersionHeight(relativeDirectory));
754+
}
755+
734756
[Fact]
735757
public void GetVersionHeight_ProjectDirectoryDifferentToVersionJsonDirectory()
736758
{

0 commit comments

Comments
 (0)