From 3e063de46e6270606e058b96bfcc0baebc4aea81 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Fri, 8 Oct 2021 19:09:54 +0000 Subject: t4034: add tests showing problematic cpp tokenizations The word regex is too loose and matches long streaks of characters that should actually be separate tokens. Add these problematic test cases. Separate the lines with text that will remain identical in the pre- and post-image so that the diff algorithm will not lump removals and additions of consecutive lines together. This makes the expected output easier to read. Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- t/t4034/cpp/expect | 22 ++++++++++++++++++---- t/t4034/cpp/post | 18 ++++++++++++++++-- t/t4034/cpp/pre | 16 +++++++++++++++- 3 files changed, 49 insertions(+), 7 deletions(-) (limited to 't') diff --git a/t/t4034/cpp/expect b/t/t4034/cpp/expect index 41976971b9..63e53a61e6 100644 --- a/t/t4034/cpp/expect +++ b/t/t4034/cpp/expect @@ -1,11 +1,25 @@ diff --git a/pre b/post -index c5672a2..4229868 100644 +index 1229cdb..3feae6f 100644 --- a/pre +++ b/post -@@ -1,16 +1,16 @@ -Foo() : x(0&&1&42) { bar(x); } +@@ -1,30 +1,30 @@ +Foo() : x(0&&1&42) { foo0bar(x.f.Find); } cout<<"Hello World!?\n"<(1) (-1e10) (0xabcdef) 'xy' +(1 -1e10+1e10 0xabcdef) 'xy' +// long double +3.141592653e-10l3.141592654e+10l +// float +120E5fE6f +// hex +0xdeadbeaf+80xdeadBeaf+7ULL +// octal +0123456701234560 +// binary +0b10000b1100+e1 +// expression +1.5-e+2+f1.5-e+3+f +// another one +str.e+65.e+75 [a] b->->*v d.e.*e ~!a !~b c+++ d--- e**f g&&&h a**=b c//=d e%%=f diff --git a/t/t4034/cpp/post b/t/t4034/cpp/post index 4229868ae6..3feae6f430 100644 --- a/t/t4034/cpp/post +++ b/t/t4034/cpp/post @@ -1,6 +1,20 @@ -Foo() : x(0&42) { bar(x); } +Foo() : x(0&42) { bar(x.Find); } cout<<"Hello World?\n"<*v d.*e ~!a !~b c+ d- e**f g&&h a*=b c/=d e%=f diff --git a/t/t4034/cpp/pre b/t/t4034/cpp/pre index c5672a24cf..1229cdb59d 100644 --- a/t/t4034/cpp/pre +++ b/t/t4034/cpp/pre @@ -1,6 +1,20 @@ -Foo():x(0&&1){} +Foo():x(0&&1){ foo0( x.find); } cout<<"Hello World!\n"<v d.e !a ~b c++ d-- e*f g&h a*b c/d e%f -- cgit v1.2.3