test: restore with missing final newline
authorDavid Bremner <david@tethera.net>
Thu, 3 Apr 2014 11:02:23 +0000 (08:02 -0300)
committerDavid Bremner <david@tethera.net>
Sat, 12 Apr 2014 10:59:44 +0000 (07:59 -0300)
Recent proposed patches for gzipped input had a bug with handling
missing newlines that was not caught by the current test suite

test/T240-dump-restore.sh

index d79aca86df3297b70763fe7613e47bdf96dcce44..b6d860202df923357c92a1bed982a7bb79198fa7 100755 (executable)
@@ -110,6 +110,15 @@ notmuch dump --format=batch-tag from:cworth | sed 's/^.*-- id://' | \
     sort > OUTPUT.$test_count
 test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
 
+test_begin_subtest "format=batch-tag, missing newline"
+printf "+a_tag_without_newline -- id:20091117232137.GA7669@griffis1.net" > IN
+notmuch restore --accumulate < IN
+notmuch dump id:20091117232137.GA7669@griffis1.net > OUT
+cat <<EOF > EXPECTED
++a_tag_without_newline +inbox +unread -- id:20091117232137.GA7669@griffis1.net
+EOF
+test_expect_equal_file EXPECTED OUT
+
 test_begin_subtest "format=batch-tag, # round-trip"
 notmuch dump --format=sup | sort > EXPECTED.$test_count
 notmuch dump --format=batch-tag | notmuch restore --format=batch-tag