t4018-diff-funcname: test syntax of builtin xfuncname patterns

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Brandon Casey 2008-09-22 18:19:05 -05:00 committed by Junio C Hamano
parent 96d1a8e9d4
commit e3bf5e43fd
1 changed files with 11 additions and 0 deletions

View File

@ -32,7 +32,18 @@ EOF

sed 's/beer\\/beer,\\/' < Beer.java > Beer-correct.java

builtin_patterns="bibtex java pascal ruby tex"
for p in $builtin_patterns
do
test_expect_success "builtin $p pattern compiles" '
echo "*.java diff=$p" > .gitattributes &&
! ( git diff --no-index Beer.java Beer-correct.java 2>&1 |
grep "fatal" > /dev/null )
'
done

test_expect_success 'default behaviour' '
rm -f .gitattributes &&
git diff --no-index Beer.java Beer-correct.java |
grep "^@@.*@@ public class Beer"
'