summaryrefslogtreecommitdiffstats
path: root/test/trailing-ws.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/trailing-ws.test')
-rw-r--r--test/trailing-ws.test62
1 files changed, 59 insertions, 3 deletions
diff --git a/test/trailing-ws.test b/test/trailing-ws.test
index 4d63a4b..2053062 100644
--- a/test/trailing-ws.test
+++ b/test/trailing-ws.test
@@ -1,25 +1,81 @@
$ mkdir d
$ cd d
- $ echo a > a
+ $ cat > a
+ < a
+ < b
+ < c
+
$ quilt new test.diff
> Patch patches/test.diff is now on top
$ quilt add a
> File a added to patch patches/test.diff
- $ echo "a " > a
+ $ cat > a
+ < a
+ < b
+ < c
+
$ quilt refresh
- > Warning: patches/test.diff adds trailing whitespace
+ > Warning: trailing whitespace in lines 1,3 of a
> Refreshed patch patches/test.diff
$ grep '[ \t]$' patches/test.diff
> +a
+ > +c
+
+ $ quilt refresh -U0
+ > Warning: trailing whitespace in lines 1,3 of a
+ > Refreshed patch patches/test.diff
$ quilt refresh --strip-trailing-whitespace
+ > Removing trailing whitespace from lines 1,3 of a
> Refreshed patch patches/test.diff
$ grep '[ \t]$' patches/test.diff
+ $ quilt pop -q
+ > Removing patch patches/test.diff
+ > No patches applied
+
+ $ cat > a
+ < a
+ < b
+ < c
+
+ $ quilt new test2.diff
+ > Patch patches/test2.diff is now on top
+
+ $ quilt add a
+ > File a added to patch patches/test2.diff
+
+ $ cat > a
+ < a
+ < b
+ < c
+
+ $ quilt refresh -c
+ > Warning: trailing whitespace in lines 1,3 of a
+ > Refreshed patch patches/test2.diff
+
+ $ grep '[ \t]$' patches/test2.diff
+ > ! a
+ > ! c
+
+ $ quilt refresh -C0
+ > Warning: trailing whitespace in lines 1,3 of a
+ > Refreshed patch patches/test2.diff
+
+ $ quilt refresh -c --strip-trailing-whitespace
+ > Removing trailing whitespace from lines 1,3 of a
+ > Refreshed patch patches/test2.diff
+
+ $ grep '[ \t]$' patches/test2.diff
+
+ $ quilt pop -q
+ > Removing patch patches/test2.diff
+ > No patches applied
+
$ cd ..
$ rm -rf d