[PATCH] test: add nontrivial test for restore --accumulate.

david at tethera.net david at tethera.net
Fri Nov 16 04:31:19 PST 2012


From: David Bremner <bremner at debian.org>

It seems we have never tested the case that restore --accumulate
actually adds tags. I noticed this when I started optimizing and no
tests failed.

I also had to modify the next test. Perhaps a seperate patch could
make these tests more independent of the previous ones.
---
 test/dump-restore |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/test/dump-restore b/test/dump-restore
index f25f7cf..ca7a730 100755
--- a/test/dump-restore
+++ b/test/dump-restore
@@ -29,18 +29,20 @@ test_expect_success 'Accumulate original tags' \
   notmuch dump > dump.actual &&
   test_cmp dump-ABC_DEF.expected dump.actual'
 
-test_expect_success 'Restoring original tags' \
-  'notmuch restore --input=dump.expected &&
-  notmuch dump > dump.actual &&
-  test_cmp dump.expected dump.actual'
-
 test_expect_success 'Restore with nothing to do' \
   'notmuch restore < dump.expected &&
   notmuch dump > dump.actual &&
   test_cmp dump.expected dump.actual'
 
+test_expect_success 'Accumulate with changes' \
+  'notmuch restore --input=dump.expected &&
+   notmuch restore --accumulate --input=dump-ABC_DEF.expected &&
+  notmuch dump >  OUTPUT.$test_count &&
+  test_cmp dump-ABC_DEF.expected OUTPUT.$test_count'
+
 test_expect_success 'Restore with nothing to do, II' \
-  'notmuch restore --accumulate --input=dump.expected &&
+  'notmuch restore --input=dump.expected &&
+  notmuch restore --accumulate --input=dump.expected &&
   notmuch dump > dump.actual &&
   test_cmp dump.expected dump.actual'
 
-- 
1.7.10.4



More information about the notmuch mailing list