Code

t4011: modernise style
[git.git] / t / t7004-tag.sh
index 73dbc4360b58c95ae135577031fb8e60b3f395f7..700b556fe886ff8e6927591e4a047542bc00ef83 100755 (executable)
@@ -583,7 +583,7 @@ test_expect_success \
 # subsequent tests require gpg; check if it is available
 gpg --version >/dev/null 2>/dev/null
 if [ $? -eq 127 ]; then
-       say "gpg not found - skipping tag signing and verification tests"
+       say "gpg not found - skipping tag signing and verification tests"
 else
        # As said here: http://www.gnupg.org/documentation/faqs.html#q6.19
        # the gpg version 1.0.6 didn't parse trust packets correctly, so for
@@ -1051,13 +1051,23 @@ test_expect_success \
 
 test_expect_success \
        'message in editor has initial comment' '
-       GIT_EDITOR=cat git tag -a initial-comment > actual
+       ! (GIT_EDITOR=cat git tag -a initial-comment > actual)
+'
+
+test_expect_success \
+       'message in editor has initial comment: first line' '
        # check the first line --- should be empty
-       first=$(sed -e 1q <actual) &&
-       test -z "$first" &&
+       echo >first.expect &&
+       sed -e 1q <actual >first.actual &&
+       test_cmp first.expect first.actual
+'
+
+test_expect_success \
+       'message in editor has initial comment: remainder' '
        # remove commented lines from the remainder -- should be empty
-       rest=$(sed -e 1d -e '/^#/d' <actual) &&
-       test -z "$rest"
+       >rest.expect
+       sed -e 1d -e '/^#/d' <actual >rest.actual &&
+       test_cmp rest.expect rest.actual
 '
 
 get_tag_header reuse $commit commit $time >expect