summaryrefslogtreecommitdiffstats
path: root/test/refresh_patch_order.test
diff options
context:
space:
mode:
authorMartin Quinson <martin.quinson@loria.fr>2014-01-17 18:28:37 +0100
committerMartin Quinson <martin.quinson@loria.fr>2014-01-17 18:28:37 +0100
commit6886ae262b9bec7786220adff1df399e206eafed (patch)
tree1314e5f6689aa3f1dc2be96ffd10f293d4a1347d /test/refresh_patch_order.test
parent1f6ce06418928d18e364064b58e2f76c034089aa (diff)
downloadquilt-6886ae262b9bec7786220adff1df399e206eafed.tar.gz
test/refresh_patch_order.test: enforces the file order within a patch
Diffstat (limited to 'test/refresh_patch_order.test')
-rw-r--r--test/refresh_patch_order.test62
1 files changed, 62 insertions, 0 deletions
diff --git a/test/refresh_patch_order.test b/test/refresh_patch_order.test
new file mode 100644
index 0000000..ec8f2ef
--- /dev/null
+++ b/test/refresh_patch_order.test
@@ -0,0 +1,62 @@
+`quilt refresh` must respect the specified file order within patch:
+
+All files that were already in the patch must be first in the file (in
+the current order), and any new file must be in alphabetic order,
+after the last file that were already in the file.
+
+ $ mkdir patches
+
+ $ echo foo >foo
+ $ echo fnord >fnord
+ $ echo zulu >zulu
+
+ $ quilt new bar
+ > Patch %{P}bar is now on top
+
+Adding two files: they are in alphabetic order
+ $ quilt add fnord zulu
+ > File fnord added to patch %{P}bar
+ > File zulu added to patch %{P}bar
+
+ $ echo x >>fnord
+ $ echo x >>zulu
+ $ quilt refresh --no-timestamps -p ab
+ > Refreshed patch %{P}bar
+
+ $ grep '^--- ' patches/bar
+ > --- a/fnord
+ > --- a/zulu
+
+Add a new file: must be placed after the last one
+ $ quilt add foo
+ > File foo added to patch %{P}bar
+
+ $ echo x >>foo
+ $ quilt refresh --no-timestamps -p ab
+ > Refreshed patch %{P}bar
+
+ $ grep '^--- ' patches/bar
+ > --- a/fnord
+ > --- a/zulu
+ > --- a/foo
+
+Remove the first file: should not change the relative order of others
+ $ echo fnord >fnord
+
+ $ quilt refresh --no-timestamps -p ab
+ > Refreshed patch %{P}bar
+
+ $ grep '^--- ' patches/bar
+ > --- a/zulu
+ > --- a/foo
+
+Readd the file: must now be last
+ $ echo x >>fnord
+
+ $ quilt refresh --no-timestamps -p ab
+ > Refreshed patch %{P}bar
+
+ $ grep '^--- ' patches/bar
+ > --- a/zulu
+ > --- a/foo
+ > --- a/fnord