t4018: test cases showing that the cpp pattern misses many anchor points
Most of the tests show C++ code, but there is also a union definition and a GNU style function definition that are not recognized. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Sixt committed
Mar 21, 2014 at 22:07 UTC
9cc444f0570b196f1c51664ce2de1d8e1dee6046
12 files changed
+66
t/t4018/cpp-class-constructor
new
+5
@@ -0,0 +1,5 @@
1
+Item::Item(int RIGHT)
2
+{
3
+ ChangeMe;
4
+ broken;
5
+}
t/t4018/cpp-class-constructor-mem-init
new
+6
@@ -0,0 +1,6 @@
1
+Item::Item(int RIGHT) :
2
+ member(0)
3
+{
4
+ ChangeMe;
5
+ broken;
6
+}
t/t4018/cpp-class-destructor
new
+5
@@ -0,0 +1,5 @@
1
+RIGHT::~RIGHT()
2
+{
3
+ ChangeMe;
4
+ broken;
5
+}
t/t4018/cpp-function-returning-global-type
new
+5
@@ -0,0 +1,5 @@
1
+::Item get::it::RIGHT()
2
+{
3
+ ChangeMe;
4
+ broken;
5
+}
t/t4018/cpp-function-returning-nested
new
+6
@@ -0,0 +1,6 @@
1
+get::Item get::it::RIGHT()
2
+{
3
+ ChangeMe;
4
+ broken;
5
+}
6
+
t/t4018/cpp-function-returning-reference
new
+5
@@ -0,0 +1,5 @@
1
+string& get::it::RIGHT(char *ptr)
2
+{
3
+ ChangeMe;
4
+ broken;
5
+}
t/t4018/cpp-gnu-style-function
new
+6
@@ -0,0 +1,6 @@
1
+const char *
2
+RIGHT(int arg)
3
+{
4
+ ChangeMe;
5
+ broken;
6
+}
t/t4018/cpp-namespace-definition
new
+5
@@ -0,0 +1,5 @@
1
+namespace RIGHT
2
+{
3
+ ChangeMe;
4
+ broken;
5
+}
t/t4018/cpp-operator-definition
new
+5
@@ -0,0 +1,5 @@
1
+Value operator+(Value LEFT, Value RIGHT)
2
+{
3
+ ChangeMe;
4
+ broken;
5
+}
t/t4018/cpp-struct-single-line
new
+8
@@ -0,0 +1,8 @@
1
+void wrong()
2
+{
3
+}
4
+
5
+struct RIGHT_iterator_tag {};
6
+
7
+int ChangeMe;
8
+// broken
t/t4018/cpp-template-function-definition
new
+5
@@ -0,0 +1,5 @@
1
+template<class T> int RIGHT(T arg)
2
+{
3
+ ChangeMe;
4
+ broken;
5
+}
t/t4018/cpp-union-definition
new
+5
@@ -0,0 +1,5 @@
1
+union RIGHT {
2
+ double v;
3
+ int ChangeMe;
4
+ broken;
5
+};