Imported Upstream version 6.4.0.137

Former-commit-id: 943baa9f16a098c33e129777827f3a9d20da00d6
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-07-26 19:53:28 +00:00
parent e9207cf623
commit ef583813eb
2712 changed files with 74169 additions and 40587 deletions

View File

@@ -396,7 +396,12 @@ namespace System.IO
/// </summary>
private bool MatchPattern(ReadOnlySpan<char> relativePath)
{
#if MONO
if (relativePath.IsWhiteSpace())
return false;
#endif
ReadOnlySpan<char> name = IO.Path.GetFileName(relativePath);
if (name.Length == 0)
return false;

View File

@@ -637,5 +637,24 @@ namespace System.IO.Tests
}
}
}
#if MONO && (!MOBILE || MOBILE_DESKTOP_HOST)
[Fact]
[PlatformSpecific(TestPlatforms.AnyUnix)]
public void FileSystemWatcher_WatchFileWithSpaces()
{
using (var testDirectory = new TempDirectory(GetTestFilePath()))
using (var file = new TempFile(Path.Combine(testDirectory.Path, " ")))
using (var watcher = new FileSystemWatcher(testDirectory.Path, "*"))
{
NotifyFilters filter = NotifyFilters.LastWrite | NotifyFilters.FileName;
watcher.NotifyFilter = filter;
Action action = () => File.AppendAllText(file.Path, "longText!");
ExpectNoEvent(watcher, WatcherChangeTypes.Changed, action, expectedPath: file.Path);
}
}
#endif
}
}