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", 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)
|
||||
{
|
||||
// arrange
|
||||
|
|
|
@ -179,6 +179,10 @@ namespace StardewModdingAPI.Framework.Content
|
|||
}
|
||||
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
|
||||
if (!curParts.Current.StartsWith(prefixParts.Current, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue