userdiff-cpp: prepare test cases with yet unsupported features

We are going to add support for C++'s digit-separating single-quote and the spaceship operator. By adding the test cases in this separate commit, the effect on the word highlighting will become more obvious as the features are implemented and the file cpp/expect is updated. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Sixt committed Oct 10, 2021 at 17:03 UTC bfaaf191a5470cb81ce327bc3b9ef9e277c9767b
3 files changed +18 -18
t/t4034/cpp/expect
+7 -7
@@ -1,21 +1,21 @@
1 <BOLD>diff --git a/pre b/post<RESET>
2 -<BOLD>index 1229cdb..3feae6f 100644<RESET>
2 +<BOLD>index 144cd98..64e78af 100644<RESET>
3 <BOLD>--- a/pre<RESET>
4 <BOLD>+++ b/post<RESET>
5 <CYAN>@@ -1,30 +1,30 @@<RESET>
6 Foo() : x(0<RED>&&1<RESET><GREEN>&42<RESET>) { <RED>foo0<RESET><GREEN>bar<RESET>(x.<RED>find<RESET><GREEN>Find<RESET>); }
7 cout<<"Hello World<RED>!<RESET><GREEN>?<RESET>\n"<<endl;
8 -<GREEN>(<RESET>1 <RED>-<RESET><GREEN>+<RESET>1e10 0xabcdef<GREEN>)<RESET> '<RED>x<RESET><GREEN>y<RESET>'
8 +<GREEN>(<RESET>1 <RED>-<RESET><GREEN>+<RESET>1e10 0xabcdef<GREEN>)<RESET> '<RED>x<RESET><GREEN>.<RESET>'
9 // long double<RESET>
10 -<RED>3.141592653e-10l<RESET><GREEN>3.141592654e+10l<RESET>
10 +3.141'592'<RED>653e-10l<RESET><GREEN>654e+10l<RESET>
11 // float<RESET>
12 <RED>120E5f<RESET><GREEN>120E6f<RESET>
13 // hex<RESET>
14 -<RED>0xdeadbeaf<RESET><GREEN>0xdeadBeaf<RESET>+<RED>8ULL<RESET><GREEN>7ULL<RESET>
14 +0xdead'<RED>beaf<RESET><GREEN>Beaf<RESET>+<RED>8ULL<RESET><GREEN>7ULL<RESET>
15 // octal<RESET>
16 -<RED>01234567<RESET><GREEN>01234560<RESET>
16 +0123'<RED>4567<RESET><GREEN>4560<RESET>
17 // binary<RESET>
18 -<RED>0b1000<RESET><GREEN>0b1100<RESET>+e1
18 +<RED>0b10<RESET><GREEN>0b11<RESET>'00+e1
19 // expression<RESET>
20 1.5-e+<RED>2<RESET><GREEN>3<RESET>+f
21 // another one<RESET>
@@ -25,7 +25,7 @@ str.e+<RED>65<RESET><GREEN>75<RESET>
25 a<RED>*<RESET><GREEN>*=<RESET>b c<RED>/<RESET><GREEN>/=<RESET>d e<RED>%<RESET><GREEN>%=<RESET>f
26 a<RED>+<RESET><GREEN>++<RESET>b c<RED>-<RESET><GREEN>--<RESET>d
27 a<RED><<<RESET><GREEN><<=<RESET>b c<RED>>><RESET><GREEN>>>=<RESET>d
28 -a<RED><<RESET><GREEN><=<RESET>b c<RED><=<RESET><GREEN><<RESET>d e<RED>><RESET><GREEN>>=<RESET>f g<RED>>=<RESET><GREEN>><RESET>h
28 +a<RED><<RESET><GREEN><=<RESET>b c<RED><=<RESET><GREEN><<RESET>d e<RED>><RESET><GREEN>>=<RESET>f g<RED>>=<RESET><GREEN>><RESET>h i<=<GREEN>><RESET>j
29 a<RED>==<RESET><GREEN>!=<RESET>b c<RED>!=<RESET><GREEN>=<RESET>d
30 a<RED>^<RESET><GREEN>^=<RESET>b c<RED>|<RESET><GREEN>|=<RESET>d e<RED>&&<RESET><GREEN>&=<RESET>f
31 a<RED>||<RESET><GREEN>|<RESET>b
t/t4034/cpp/post
+6 -6
@@ -1,16 +1,16 @@
1 Foo() : x(0&42) { bar(x.Find); }
2 cout<<"Hello World?\n"<<endl;
3 -(1 +1e10 0xabcdef) 'y'
3 +(1 +1e10 0xabcdef) '.'
4 // long double
5 -3.141592654e+10l
5 +3.141'592'654e+10l
6 // float
7 120E6f
8 // hex
9 -0xdeadBeaf+7ULL
9 +0xdead'Beaf+7ULL
10 // octal
11 -01234560
11 +0123'4560
12 // binary
13 -0b1100+e1
13 +0b11'00+e1
14 // expression
15 1.5-e+3+f
16 // another one
@@ -20,7 +20,7 @@ str.e+75
20 a*=b c/=d e%=f
21 a++b c--d
22 a<<=b c>>=d
23 -a<=b c<d e>=f g>h
23 +a<=b c<d e>=f g>h i<=>j
24 a!=b c=d
25 a^=b c|=d e&=f
26 a|b
t/t4034/cpp/pre
+5 -5
@@ -2,15 +2,15 @@ Foo():x(0&&1){ foo0( x.find); }
2 cout<<"Hello World!\n"<<endl;
3 1 -1e10 0xabcdef 'x'
4 // long double
5 -3.141592653e-10l
5 +3.141'592'653e-10l
6 // float
7 120E5f
8 // hex
9 -0xdeadbeaf+8ULL
9 +0xdead'beaf+8ULL
10 // octal
11 -01234567
11 +0123'4567
12 // binary
13 -0b1000+e1
13 +0b10'00+e1
14 // expression
15 1.5-e+2+f
16 // another one
@@ -20,7 +20,7 @@ str.e+65
20 a*b c/d e%f
21 a+b c-d
22 a<<b c>>d
23 -a<b c<=d e>f g>=h
23 +a<b c<=d e>f g>=h i<=j
24 a==b c!=d
25 a^b c|d e&&f
26 a||b