fix this case.
This commit is contained in:
parent
4dcc6904b9
commit
b99dbf53bd
|
@ -245,6 +245,8 @@ namespace SMAPI.Tests.Core
|
||||||
|
|
||||||
[TestCase("Mods/SomeMod/SomeSubdirectory", "Mods/Some", true, ExpectedResult = true)]
|
[TestCase("Mods/SomeMod/SomeSubdirectory", "Mods/Some", true, ExpectedResult = true)]
|
||||||
[TestCase("Mods/SomeMod/SomeSubdirectory", "Mods/Some", false, ExpectedResult = false)]
|
[TestCase("Mods/SomeMod/SomeSubdirectory", "Mods/Some", false, ExpectedResult = false)]
|
||||||
|
[TestCase("Mods/Jasper/Data", "Mods/Jas/Image", true, ExpectedResult = false)]
|
||||||
|
[TestCase("Mods/Jasper/Data", "Mods/Jas/Image", true, ExpectedResult = false)]
|
||||||
public bool StartsWith_SubfolderWithPartial(string mainAssetName, string otherAssetName, bool allowSubfolder)
|
public bool StartsWith_SubfolderWithPartial(string mainAssetName, string otherAssetName, bool allowSubfolder)
|
||||||
{
|
{
|
||||||
// arrange
|
// arrange
|
||||||
|
|
|
@ -179,6 +179,10 @@ namespace StardewModdingAPI.Framework.Content
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// mismatch: prefix has more beyond this, and this segment isn't an exact match
|
||||||
|
if (prefixParts.Remainder.Length != 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
// mismatch: cur segment doesn't start with prefix
|
// mismatch: cur segment doesn't start with prefix
|
||||||
if (!curParts.Current.StartsWith(prefixParts.Current, StringComparison.OrdinalIgnoreCase))
|
if (!curParts.Current.StartsWith(prefixParts.Current, StringComparison.OrdinalIgnoreCase))
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue