Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@ public async Task TokensFiredForOldAndNewNamesOnRename()
}
}

[Fact]
[ConditionalFact]
[SkipOnPlatform(TestPlatforms.Browser | TestPlatforms.Wasi | TestPlatforms.iOS | TestPlatforms.tvOS, "System.IO.FileSystem.Watcher is not supported on Browser/WASI/iOS/tvOS")]
public async Task TokensFiredForNewDirectoryContentsOnRename()
{
Expand All @@ -1270,6 +1270,13 @@ void Fail(object state)
using (var physicalFilesWatcher = new PhysicalFilesWatcher(root.Path + Path.DirectorySeparatorChar, fileSystemWatcher, pollForChanges: false))
using (var provider = new PhysicalFileProvider(root.Path) { FileWatcher = physicalFilesWatcher })
{
// This test only relies on the watcher events that are injected below via
// fileSystemWatcher.CallOnRenamed, which invokes FileSystemWatcher.OnRenamed directly and
// so bypasses Filter matching. Setting a Filter that cannot match any of the (randomly
// generated) names used by this test suppresses any genuine native events - e.g. ones
// belatedly reported by macOS fseventsd for the directory/file creation below.
fileSystemWatcher.Filter = "this-filter-does-not-match-anything";

var oldDirectoryName = Guid.NewGuid().ToString();
var oldSubDirectoryName = Guid.NewGuid().ToString();
var oldSubDirectoryPath = Path.Combine(oldDirectoryName, oldSubDirectoryName);
Expand Down