[Alpha PATCH 6/6] test: second set of dump/restore --format=notmuch tests
On Tue, 13 Dec 2011 16:27:55 -0400, David Bremner wrote: > From: David Bremner > > These one need the completed functionality in notmuch-restore. Fairly > exotic tags are tested, but no weird message id's. > --- > test/dump-restore | 33 + > 1 files changed, 33 insertions(+), 0 deletions(-) > > diff --git a/test/dump-restore b/test/dump-restore > index 48caf4e..122de5c 100755 > --- a/test/dump-restore > +++ b/test/dump-restore > @@ -94,4 +94,37 @@ notmuch dump --format=sup -- from:cworth | tr -d \(\) > > EXPECTED.$test_count > notmuch dump --format=notmuch -- from:cworth > OUTPUT.$test_count > test_expect_equal_file OUTPUT.$test_count EXPECTED.$test_count > > +test_begin_subtest "format=notmuch, # round-trip" > +notmuch dump --format=sup | sort > EXPECTED.$test_count > +notmuch dump --format=notmuch | notmuch restore --format=notmuch > +notmuch dump --format=sup | sort > OUTPUT.$test_count > +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count > + > +tag1='comic_swear=$&^%$^%\\//-+$^%$' > +enc1=$($TEST_DIRECTORY/hex-xcode e "$tag1") > + > +tag2=$(printf 'this\n tag\t has\n spaces') > +enc2=$($TEST_DIRECTORY/hex-xcode e "$tag2") > + > +notmuch dump --format=notmuch > BACKUP > + > +notmuch tag +"$tag1" +"$tag2" -inbox -unread "*" > + > +test_begin_subtest 'format=notmuch, round trip with strange tags' > + notmuch dump --format=notmuch > EXPECTED.$test_count > + notmuch dump --format=notmuch | notmuch restore --format=notmuch > + notmuch dump --format=notmuch > OUTPUT.$test_count Noticed this while looking at the 8bit patch. The indent offset should be 4. Regards, Dmitry > +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count > + > + > +test_begin_subtest 'format=notmuch, checking encoded output' > +cp /dev/null EXPECTED.$test_count > +notmuch dump --format=notmuch -- from:cworth |\ > + awk "{ print \$1 \" $enc1 $enc2\" }" > EXPECTED.$test_count > + > +notmuch dump --format=notmuch -- from:cworth > OUTPUT.$test_count > +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count > + > +notmuch restore --format=notmuch < BACKUP > + > test_done > -- > 1.7.5.4 > > ___ > notmuch mailing list > notmuch at notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch
Re: [Alpha PATCH 6/6] test: second set of dump/restore --format=notmuch tests
On Tue, 13 Dec 2011 16:27:55 -0400, David Bremner da...@tethera.net wrote: From: David Bremner brem...@debian.org These one need the completed functionality in notmuch-restore. Fairly exotic tags are tested, but no weird message id's. --- test/dump-restore | 33 + 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/test/dump-restore b/test/dump-restore index 48caf4e..122de5c 100755 --- a/test/dump-restore +++ b/test/dump-restore @@ -94,4 +94,37 @@ notmuch dump --format=sup -- from:cworth | tr -d \(\) EXPECTED.$test_count notmuch dump --format=notmuch -- from:cworth OUTPUT.$test_count test_expect_equal_file OUTPUT.$test_count EXPECTED.$test_count +test_begin_subtest format=notmuch, # round-trip +notmuch dump --format=sup | sort EXPECTED.$test_count +notmuch dump --format=notmuch | notmuch restore --format=notmuch +notmuch dump --format=sup | sort OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +tag1='comic_swear=$^%$^%\\//-+$^%$' +enc1=$($TEST_DIRECTORY/hex-xcode e $tag1) + +tag2=$(printf 'this\n tag\t has\n spaces') +enc2=$($TEST_DIRECTORY/hex-xcode e $tag2) + +notmuch dump --format=notmuch BACKUP + +notmuch tag +$tag1 +$tag2 -inbox -unread * + +test_begin_subtest 'format=notmuch, round trip with strange tags' + notmuch dump --format=notmuch EXPECTED.$test_count + notmuch dump --format=notmuch | notmuch restore --format=notmuch + notmuch dump --format=notmuch OUTPUT.$test_count Noticed this while looking at the 8bit patch. The indent offset should be 4. Regards, Dmitry +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + + +test_begin_subtest 'format=notmuch, checking encoded output' +cp /dev/null EXPECTED.$test_count +notmuch dump --format=notmuch -- from:cworth |\ + awk { print \$1 \ $enc1 $enc2\ } EXPECTED.$test_count + +notmuch dump --format=notmuch -- from:cworth OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +notmuch restore --format=notmuch BACKUP + test_done -- 1.7.5.4 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[Alpha PATCH 6/6] test: second set of dump/restore --format=notmuch tests
From: David BremnerThese one need the completed functionality in notmuch-restore. Fairly exotic tags are tested, but no weird message id's. --- test/dump-restore | 33 + 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/test/dump-restore b/test/dump-restore index 48caf4e..122de5c 100755 --- a/test/dump-restore +++ b/test/dump-restore @@ -94,4 +94,37 @@ notmuch dump --format=sup -- from:cworth | tr -d \(\) > EXPECTED.$test_count notmuch dump --format=notmuch -- from:cworth > OUTPUT.$test_count test_expect_equal_file OUTPUT.$test_count EXPECTED.$test_count +test_begin_subtest "format=notmuch, # round-trip" +notmuch dump --format=sup | sort > EXPECTED.$test_count +notmuch dump --format=notmuch | notmuch restore --format=notmuch +notmuch dump --format=sup | sort > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +tag1='comic_swear=$&^%$^%\\//-+$^%$' +enc1=$($TEST_DIRECTORY/hex-xcode e "$tag1") + +tag2=$(printf 'this\n tag\t has\n spaces') +enc2=$($TEST_DIRECTORY/hex-xcode e "$tag2") + +notmuch dump --format=notmuch > BACKUP + +notmuch tag +"$tag1" +"$tag2" -inbox -unread "*" + +test_begin_subtest 'format=notmuch, round trip with strange tags' + notmuch dump --format=notmuch > EXPECTED.$test_count + notmuch dump --format=notmuch | notmuch restore --format=notmuch + notmuch dump --format=notmuch > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + + +test_begin_subtest 'format=notmuch, checking encoded output' +cp /dev/null EXPECTED.$test_count +notmuch dump --format=notmuch -- from:cworth |\ +awk "{ print \$1 \" $enc1 $enc2\" }" > EXPECTED.$test_count + +notmuch dump --format=notmuch -- from:cworth > OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +notmuch restore --format=notmuch < BACKUP + test_done -- 1.7.5.4
[Alpha PATCH 6/6] test: second set of dump/restore --format=notmuch tests
From: David Bremner brem...@debian.org These one need the completed functionality in notmuch-restore. Fairly exotic tags are tested, but no weird message id's. --- test/dump-restore | 33 + 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/test/dump-restore b/test/dump-restore index 48caf4e..122de5c 100755 --- a/test/dump-restore +++ b/test/dump-restore @@ -94,4 +94,37 @@ notmuch dump --format=sup -- from:cworth | tr -d \(\) EXPECTED.$test_count notmuch dump --format=notmuch -- from:cworth OUTPUT.$test_count test_expect_equal_file OUTPUT.$test_count EXPECTED.$test_count +test_begin_subtest format=notmuch, # round-trip +notmuch dump --format=sup | sort EXPECTED.$test_count +notmuch dump --format=notmuch | notmuch restore --format=notmuch +notmuch dump --format=sup | sort OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +tag1='comic_swear=$^%$^%\\//-+$^%$' +enc1=$($TEST_DIRECTORY/hex-xcode e $tag1) + +tag2=$(printf 'this\n tag\t has\n spaces') +enc2=$($TEST_DIRECTORY/hex-xcode e $tag2) + +notmuch dump --format=notmuch BACKUP + +notmuch tag +$tag1 +$tag2 -inbox -unread * + +test_begin_subtest 'format=notmuch, round trip with strange tags' + notmuch dump --format=notmuch EXPECTED.$test_count + notmuch dump --format=notmuch | notmuch restore --format=notmuch + notmuch dump --format=notmuch OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + + +test_begin_subtest 'format=notmuch, checking encoded output' +cp /dev/null EXPECTED.$test_count +notmuch dump --format=notmuch -- from:cworth |\ +awk { print \$1 \ $enc1 $enc2\ } EXPECTED.$test_count + +notmuch dump --format=notmuch -- from:cworth OUTPUT.$test_count +test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count + +notmuch restore --format=notmuch BACKUP + test_done -- 1.7.5.4 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch