Repository navigation
test: add interop tests for --iconv with non-ASCII filter rules (#3490) - #5396
Merged
Merged
Conversation
Verify that filter rules containing non-ASCII patterns interact correctly with --iconv filename transcoding. Tests cover: - Exclude patterns with non-ASCII chars preventing iconv-transcoded copy - Include patterns with non-ASCII chars allowing files under iconv - Filter evaluation in reverse iconv direction (Latin-1 to UTF-8) - Surviving files correctly transcoded when filter is active - Encoding mismatch edge case (UTF-8 pattern vs Latin-1 source names) - Mixed include/exclude chains with multiple non-ASCII patterns - Nested directory filtering under iconv All tests are gated on cfg(all(target_os = "linux", feature = "iconv")) because macOS/Windows filesystems reject raw non-UTF-8 byte sequences.
The include_non_ascii_pattern_allows_file_under_iconv test used --include='résumé*' --exclude='*' without a directory traversal rule. The --exclude='*' matched the source directory itself, preventing any files from being copied. Add --include='*/' to permit directory traversal, matching the standard upstream rsync idiom for include+exclude-all filter chains.
On macOS, /var is a symlink to /private/var. TempDir creates paths under /var/folders/... but emit_implied_parents uses symlink_metadata which returns false for is_dir() on symlink components. This caused the ancestor assertion to fail looking for a bare "var" directory entry. Canonicalizing the tempdir path resolves the symlink before building the test source path, ensuring all ancestor components are real directories.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
… (#5396) * test: add interop tests for --iconv with non-ASCII filter rules (#3490) Verify that filter rules containing non-ASCII patterns interact correctly with --iconv filename transcoding. Tests cover: - Exclude patterns with non-ASCII chars preventing iconv-transcoded copy - Include patterns with non-ASCII chars allowing files under iconv - Filter evaluation in reverse iconv direction (Latin-1 to UTF-8) - Surviving files correctly transcoded when filter is active - Encoding mismatch edge case (UTF-8 pattern vs Latin-1 source names) - Mixed include/exclude chains with multiple non-ASCII patterns - Nested directory filtering under iconv All tests are gated on cfg(all(target_os = "linux", feature = "iconv")) because macOS/Windows filesystems reject raw non-UTF-8 byte sequences. * style: apply cargo fmt formatting * fix: add directory include rule to iconv filter test The include_non_ascii_pattern_allows_file_under_iconv test used --include='résumé*' --exclude='*' without a directory traversal rule. The --exclude='*' matched the source directory itself, preventing any files from being copied. Add --include='*/' to permit directory traversal, matching the standard upstream rsync idiom for include+exclude-all filter chains. * fix: canonicalize tempdir path in relative-source test for macOS On macOS, /var is a symlink to /private/var. TempDir creates paths under /var/folders/... but emit_implied_parents uses symlink_metadata which returns false for is_dir() on symlink components. This caused the ancestor assertion to fail looking for a bare "var" directory entry. Canonicalizing the tempdir path resolves the symlink before building the test source path, ensuring all ancestor components are real directories.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
--iconvfilename transcoding interacts correctly with filter rules containing non-ASCII patterns (ICV-5 docs: comment cleanup in logging and logging-sink crates #3490)check_filter()->send_file_name()ordering inexclude.c/flist.ccfg(all(target_os = "linux", feature = "iconv"))since macOS/Windows filesystems reject raw non-UTF-8 byte sequencesTest plan