Merge branch 'gh/userdiff-matlab'

* gh/userdiff-matlab:
  Add built-in diff patterns for MATLAB code
This commit is contained in:
Junio C Hamano
2011-12-05 15:26:21 -08:00
7 changed files with 39 additions and 1 deletions

View File

@ -105,7 +105,7 @@ test_expect_funcname () {
grep "^@@.*@@ $1" diff
}
for p in bibtex cpp csharp fortran html java objc pascal perl php python ruby tex
for p in bibtex cpp csharp fortran html java matlab objc pascal perl php python ruby tex
do
test_expect_success "builtin $p pattern compiles" '
echo "*.java diff=$p" >.gitattributes &&

View File

@ -299,6 +299,7 @@ test_language_driver csharp
test_language_driver fortran
test_language_driver html
test_language_driver java
test_language_driver matlab
test_language_driver objc
test_language_driver pascal
test_language_driver perl

14
t/t4034/matlab/expect Normal file
View File

@ -0,0 +1,14 @@
<BOLD>diff --git a/pre b/post<RESET>
<BOLD>index dc204db..70e05f0 100644<RESET>
<BOLD>--- a/pre<RESET>
<BOLD>+++ b/post<RESET>
<CYAN>@@ -1,9 +1,9 @@<RESET>
(<RED>1<RESET><GREEN>0<RESET>) (<RED>-1e10<RESET><GREEN>-0e10<RESET>) '<RED>b<RESET><GREEN>y<RESET>';
[<RED>a<RESET><GREEN>x<RESET>] {<RED>a<RESET><GREEN>x<RESET>} <RED>a<RESET><GREEN>x<RESET>.<RED>b<RESET><GREEN>y<RESET>;
~<RED>a<RESET><GREEN>x<RESET>;
<RED>a<RESET><GREEN>x<RESET>*<RED>b a<RESET><GREEN>y x<RESET>.*<RED>b a<RESET><GREEN>y x<RESET>/<RED>b a<RESET><GREEN>y x<RESET>./<RED>b a<RESET><GREEN>y x<RESET>^<RED>b a<RESET><GREEN>y x<RESET>.^<RED>b a<RESET><GREEN>y x<RESET>.\<RED>b a<RESET><GREEN>y x<RESET>.';
<RED>a<RESET><GREEN>x<RESET>+<RED>b a<RESET><GREEN>y x<RESET>-<RED>b<RESET><GREEN>y<RESET>;
<RED>a<RESET><GREEN>x<RESET>&<RED>b a<RESET><GREEN>y x<RESET>&&<RED>b a<RESET><GREEN>y x<RESET>|<RED>b a<RESET><GREEN>y x<RESET>||<RED>b<RESET><GREEN>y<RESET>;
<RED>a<RESET><GREEN>x<RESET><<RED>b a<RESET><GREEN>y x<RESET><=<RED>b a<RESET><GREEN>y x<RESET>><RED>b a<RESET><GREEN>y x<RESET>>=<RED>b<RESET><GREEN>y<RESET>;
<RED>a<RESET><GREEN>x<RESET>==<RED>b a<RESET><GREEN>y x<RESET>~=<RED>b<RESET><GREEN>y<RESET>;
<RED>a<RESET><GREEN>x<RESET>,<RED>b<RESET><GREEN>y<RESET>;

9
t/t4034/matlab/post Normal file
View File

@ -0,0 +1,9 @@
(0) (-0e10) 'y';
[x] {x} x.y;
~x;
x*y x.*y x/y x./y x^y x.^y x.\y x.';
x+y x-y;
x&y x&&y x|y x||y;
x<y x<=y x>y x>=y;
x==y x~=y;
x,y;

9
t/t4034/matlab/pre Normal file
View File

@ -0,0 +1,9 @@
(1) (-1e10) 'b';
[a] {a} a.b;
~a;
a*b a.*b a/b a./b a^b a.^b a.\b a.';
a+b a-b;
a&b a&&b a|b a||b;
a<b a<=b a>b a>=b;
a==b a~=b;
a,b;