test -z "$bad"
'
-test_expect_failure 'Check invalid atoms names are errors' '
- git-for-each-ref --format="%(INVALID)" refs/heads
+test_expect_success 'Check invalid atoms names are errors' '
+ ! git-for-each-ref --format="%(INVALID)" refs/heads
'
test_expect_success 'Check format specifiers are ignored in naming date atoms' '
git-for-each-ref --format="%(authordate:rfc2822)" refs/heads
'
-test_expect_failure 'Check invalid format specifiers are errors' '
- git-for-each-ref --format="%(authordate:INVALID)" refs/heads
+test_expect_success 'Check invalid format specifiers are errors' '
+ ! git-for-each-ref --format="%(authordate:INVALID)" refs/heads
'
cat >expected <<\EOF
test_expect_success 'Check unformatted date fields output' '
(git for-each-ref --shell --format="%(refname) %(committerdate) %(authordate)" refs/heads &&
git for-each-ref --shell --format="%(refname) %(taggerdate)" refs/tags) >actual &&
- git diff expected actual
+ test_cmp expected actual
'
test_expect_success 'Check format "default" formatted date fields output' '
f=default &&
(git for-each-ref --shell --format="%(refname) %(committerdate:$f) %(authordate:$f)" refs/heads &&
git for-each-ref --shell --format="%(refname) %(taggerdate:$f)" refs/tags) >actual &&
- git diff expected actual
+ test_cmp expected actual
'
# Don't know how to do relative check because I can't know when this script
f=short &&
(git for-each-ref --shell --format="%(refname) %(committerdate:$f) %(authordate:$f)" refs/heads &&
git for-each-ref --shell --format="%(refname) %(taggerdate:$f)" refs/tags) >actual &&
- git diff expected actual
+ test_cmp expected actual
'
cat >expected <<\EOF
f=local &&
(git for-each-ref --shell --format="%(refname) %(committerdate:$f) %(authordate:$f)" refs/heads &&
git for-each-ref --shell --format="%(refname) %(taggerdate:$f)" refs/tags) >actual &&
- git diff expected actual
+ test_cmp expected actual
'
cat >expected <<\EOF
f=iso8601 &&
(git for-each-ref --shell --format="%(refname) %(committerdate:$f) %(authordate:$f)" refs/heads &&
git for-each-ref --shell --format="%(refname) %(taggerdate:$f)" refs/tags) >actual &&
- git diff expected actual
+ test_cmp expected actual
'
cat >expected <<\EOF
f=rfc2822 &&
(git for-each-ref --shell --format="%(refname) %(committerdate:$f) %(authordate:$f)" refs/heads &&
git for-each-ref --shell --format="%(refname) %(taggerdate:$f)" refs/tags) >actual &&
- git diff expected actual
+ test_cmp expected actual
'
cat >expected <<\EOF
test_expect_success 'Verify ascending sort' '
git-for-each-ref --format="%(refname)" --sort=refname >actual &&
- git diff expected actual
+ test_cmp expected actual
'
test_expect_success 'Verify descending sort' '
git-for-each-ref --format="%(refname)" --sort=-refname >actual &&
- git diff expected actual
+ test_cmp expected actual
'
cat >expected <<\EOF
test_expect_success 'Quoting style: shell' '
git for-each-ref --shell --format="%(refname)" >actual &&
- git diff expected actual
+ test_cmp expected actual
'
test_expect_success 'Quoting style: perl' '
git for-each-ref --perl --format="%(refname)" >actual &&
- git diff expected actual
+ test_cmp expected actual
'
test_expect_success 'Quoting style: python' '
git for-each-ref --python --format="%(refname)" >actual &&
- git diff expected actual
+ test_cmp expected actual
'
cat >expected <<\EOF
test_expect_success 'Quoting style: tcl' '
git for-each-ref --tcl --format="%(refname)" >actual &&
- git diff expected actual
+ test_cmp expected actual
'
for i in "--perl --shell" "-s --python" "--python --tcl" "--tcl --perl"; do