SHA256
1
0
forked from pool/quilt
quilt/edit-01-test-file-creation.patch
Jean Delvare 6c57f63fdf Translation fixes:
- translation-fixes-01.patch: Make gettext happy (needed so that
  following patches apply cleanly.)
- translation-fixes-02.patch: Missing escape in Japanese
  translation.
- translation-fixes-03.patch: Improve the German translation
  (including a number of important fixes.)
- translation-fixes-04.patch: Fix translation of main usage message
  (all languages.)
Fixes to the "edit" command:
- edit-01-test-file-creation.patch: edit: Improve the test case
  (needed so that following patches apply cleanly.)
- edit-02-call-remove-not-revert.patch: edit: Use command "remove"
  to remove files.
- edit-03-fix-corner-case.patch: edit: Fix a corner case.

OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/quilt?expand=0&rev=100
2015-02-16 16:29:50 +00:00

67 lines
1.3 KiB
Diff

From: Jean Delvare <jdelvare@suse.de>
Subject: edit: Improve the test case
Upstream: Submitted (2011-02-11)
Cover one more use case of the "edit" command in the test case: file
creation.
Also reorder some of the commands to make the tests easier to follow.
The intent is easier to understand when the result is tested after
each command.
---
test/edit.test | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
--- a/test/edit.test
+++ b/test/edit.test
@@ -1,5 +1,6 @@
$ mkdir patches subdir
+# Test the behavior if the editor modifies existing files
$ cat > editor
< #! /bin/sh
< echo Editing $1
@@ -16,15 +17,15 @@ $ quilt edit foobar
> File foobar added to patch patches/patch
> Editing foobar
+$ cat foobar
+> barbar
+
$ cd subdir
$ echo foo > foo
$ quilt edit foo
> File subdir/foo added to patch ../patches/patch
> Editing subdir/foo
-
$ cd ..
-$ cat foobar
-> barbar
$ cat subdir/foo
> bar
@@ -32,3 +33,23 @@ $ cat subdir/foo
$ quilt files
> foobar
> subdir/foo
+
+$ quilt refresh
+> Refreshed patch patches/patch
+
+# Test the behavior if the editor creates a brand new file
+$ cat > editor
+< #! /bin/sh
+< echo Creating $1
+< echo "new line" > $1
+
+$ quilt edit foo2
+> File foo2 added to patch patches/patch
+> Creating foo2
+$ cat foo2
+> new line
+
+$ quilt files -v
+> + foo2
+> foobar
+> subdir/foo