fix: additional NotifyFilterTests #913
Open
+299
−138
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR provides some additional test cases as requested. It is not intended to be merged in its current state.
Four new tests are added to
Testably.Abstractions.Tests.FileSystem.FileSystemWatcher.NotifyFiltersTests:NotifyFilter_MoveFileOutOfTheWatchedDirectory_ShouldTriggerRenamed_OnLinuxOrMacNotifyFilter_MoveFileInToTheWatchedDirectory_ShouldTriggerRenamed_OnLinuxOrMacNotifyFilter_MoveDirectoryOutOfTheWatchedDirectory_ShouldTriggerRenamedEventOnNotifyFilters_OnLinuxOrMacNotifyFilter_MoveDirectoryInToTheWatchedDirectory_ShouldTriggerRenamedEventOnNotifyFilters_OnLinuxOrMacThese are parallels to the existing Windows-only tests that test the expected behaviour of the same scenarios on Linux and Mac. On Windows, these move operations trigger Created or Deleted events, whilst on Linux or Mac they trigger Renamed events.
These tests all pass with
Testably.Abstractions.Testing5.0.0 but all fail with 5.0.1, following the fix #900 for issue #899. I believe that these tests are valid and that this is a regression. The problem seems to be inTransformPathAndName, which expects its argument to start withFullPath, but in these tests the argument does not start withFullPath, so it chops part of the actual path off. I guess some logic that was removed in #900 needs to be restored but I'm not sure what.