git: cc36624b2a8b - main - patch: test for unified diffs with spaces in filenames
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 29 Aug 2025 19:24:57 UTC
The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=cc36624b2a8be3fbf180c5ae8d310d86486884bc commit cc36624b2a8be3fbf180c5ae8d310d86486884bc Author: Kyle Evans <kevans@FreeBSD.org> AuthorDate: 2025-08-29 19:24:35 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2025-08-29 19:24:35 +0000 patch: test for unified diffs with spaces in filenames The older GNU patch that we had in base did not properly handle spaces in filenames in unified diffs, but bsdpatch seems to have handled this fine at least since the version we imported into base initially. Add a test with spaces in the filename specifically to be sure. PR: 181272 --- usr.bin/patch/tests/unified_patch_test.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/usr.bin/patch/tests/unified_patch_test.sh b/usr.bin/patch/tests/unified_patch_test.sh index 47c4dc5faf73..a4b46ef34221 100755 --- a/usr.bin/patch/tests/unified_patch_test.sh +++ b/usr.bin/patch/tests/unified_patch_test.sh @@ -161,6 +161,23 @@ file_removal_body() atf_check -o inline:"y\n" cat foo } +atf_test_case namespace +namespace_head() +{ + atf_set "descr" "Test that patch(1) handles files with spaces in the name" +} +namespace_body() +{ + echo "ABC" > "with spaces.orig" + echo "ZYX" > "with spaces" + + atf_check -s not-exit:0 -o save:spaces.diff \ + diff -u "with spaces.orig" "with spaces" + + atf_check mv "with spaces.orig" "with spaces" + atf_check -o not-empty patch < spaces.diff +} + atf_test_case plinelen plinelen_body() { @@ -187,5 +204,6 @@ atf_init_test_cases() atf_add_test_case file_creation atf_add_test_case file_nodupe atf_add_test_case file_removal + atf_add_test_case namespace atf_add_test_case plinelen }