Projects
Factory:RISC-V:Base
patch
_service:tar_scm:backport-Add-missing-section-t...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:backport-Add-missing-section-tests-to-context-format-test-cas.patch of Package patch
From 3a4a357daa920361d709bbc4cf43865dff769112 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher <agruen@gnu.org> Date: Tue, 30 Jul 2019 12:10:19 +0200 Subject: [PATCH 6/8] Add missing-section tests to context-format test case * tests/context-format: Add tests with a missing pattern and a missing replacement section in a hunk. Patch should fill in the missing sections from the existing sections. Signed-off-by: Xibo.Wang <wangxb12@chinatelecom.cn> --- tests/context-format | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 2 deletions(-) diff --git a/tests/context-format b/tests/context-format index 8143448..b3276ff 100644 --- a/tests/context-format +++ b/tests/context-format @@ -11,6 +11,46 @@ use_tmpdir # ============================================================== +printf "%s\n" 1 2 4 5 > a +cat > ab.diff <<EOF +*** a +--- b +*************** +*** 1,4 **** +--- 1,5 ---- + 1 + 2 ++ 3 + 4 + 5 +EOF + +check 'patch < ab.diff' <<EOF +patching file a +EOF + +printf "%s\n" 1 2 3 4 5 > a +cat > ab.diff <<EOF +*** a +--- b +*************** +*** 1,5 **** + 1 + 2 +- 3 + 4 + 5 +--- 1,4 ---- +EOF + +check 'patch < ab.diff' <<EOF +patching file a +EOF + +# -------------------------------------------------------------- + +printf "%s\n" a a a a a b a a a a a > a + cat > ab.diff <<EOF *** a --- b @@ -20,11 +60,33 @@ cat > ab.diff <<EOF --- 5 ---- EOF -printf "%s\n" a a a a a b a a a a a > a check 'patch < ab.diff' <<EOF patching file a EOF +check 'echo `cat a`' <<EOF +a a a a a a a a a a +EOF + +cat > ba.diff <<EOF +*** b +--- a +*************** +*** 5 **** +--- 6 ---- ++ b +EOF + +check 'patch < ba.diff' <<EOF +patching file a +EOF + +check 'echo `cat a`' <<EOF +a a a a a b a a a a a +EOF + +printf "%s\n" a a a a a a a a a a b > a + cat > ab.diff <<EOF *** a --- b @@ -34,7 +96,27 @@ cat > ab.diff <<EOF --- 10 ---- EOF -printf "%s\n" a a a a a a a a a a b > a check 'patch < ab.diff' <<EOF patching file a EOF + +check 'echo `cat a`' <<EOF +a a a a a a a a a a +EOF + +cat > ba.diff <<EOF +*** b +--- a +*************** +*** 10 **** +--- 11 ---- ++ b +EOF + +check 'patch < ba.diff' <<EOF +patching file a +EOF + +check 'echo `cat a`' <<EOF +a a a a a a a a a a b +EOF -- 1.8.3.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2