diff options
author | Jean Delvare <jdelvare@suse.de> | 2015-02-18 12:59:59 +0100 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2015-02-18 12:59:59 +0100 |
commit | acebe0c18cd9d9b755fae5d6f071ca02f896270b (patch) | |
tree | 44b703ba28e6a86f88607e865fde4dcc1aace703 /test/edit.test | |
parent | 6b3fbd5c7d2e8513b31f6fee0a0abc5622bd76dc (diff) | |
download | quilt-acebe0c18cd9d9b755fae5d6f071ca02f896270b.tar.gz |
edit: Improve the test case
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.
Diffstat (limited to 'test/edit.test')
-rw-r--r-- | test/edit.test | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/test/edit.test b/test/edit.test index eb38b7a..eabe752 100644 --- 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 |