aboutsummaryrefslogtreecommitdiff
path: root/t/t4034/cpp/post
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2021-10-08 19:09:53 +0000
committerJunio C Hamano <gitster@pobox.com>2021-10-08 13:04:07 -0700
commit1cf93847c1edf3128f3a2fd87db6a490470ce4ec (patch)
tree186253928ba9c3ba5ba567640e8b6bedf174d695 /t/t4034/cpp/post
parent106298f7f9cca4158a980de149ef217751e1f943 (diff)
downloadgit-1cf93847c1edf3128f3a2fd87db6a490470ce4ec.tar.xz
t4034/cpp: actually test that operator tokens are not split
8d96e7288f2b (t4034: bulk verify builtin word regex sanity, 2010-12-18) added many tests with the intent to verify that operators consisting of more than one symbol are kept together. These are tested by probing a transition from, e.g., a!=b to x!=y, which results in the word-diff [-a-]{+x+}!=[-b-]{+y+} But that proves only that the letters and operators are separate tokens. To prove that != is an unseparable token, we have to probe a transition from, e.g., a=b to a!=b having a word-diff a[-=-]{+!=+}b that proves that the ! is not separate from the =. In the post-image, add to or remove from operators a character that turns it into another valid operator. Change the identifiers used around operators such that the diff algorithm does not have an incentive to match, e.g., a<b in one spot in the pre-image with a<b elsewhere in the post-image. Adjust the expected output to match the new differences. Notice that there are some undesirable tokenizations around e, ., and -. This will be addressed in a later change. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4034/cpp/post')
-rw-r--r--t/t4034/cpp/post29
1 files changed, 13 insertions, 16 deletions
diff --git a/t/t4034/cpp/post b/t/t4034/cpp/post
index 7e8c026cef..4229868ae6 100644
--- a/t/t4034/cpp/post
+++ b/t/t4034/cpp/post
@@ -1,19 +1,16 @@
Foo() : x(0&42) { bar(x); }
cout<<"Hello World?\n"<<endl;
(1) (-1e10) (0xabcdef) 'y'
-[x] x->y x.y
-!x ~x x++ 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
-x==y x!=y
-x&y
-x^y
-x|y
-x&&y
-x||y
-x?y:z
-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
+[a] b->*v d.*e
+~!a !~b c+ d- e**f g&&h
+a*=b c/=d e%=f
+a++b c--d
+a<<=b c>>=d
+a<=b c<d e>=f g>h
+a!=b c=d
+a^=b c|=d e&=f
+a|b
+a?:b
+a==b c+d e-f g*h i/j k%l m<<n o>>p q&r s^t u|v
+a,b
+a:b