Skip to content

Commit

Permalink
t4018: test cases showing that the cpp pattern misses many anchor points
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Sixt authored and Junio C Hamano committed Mar 21, 2014
1 parent 02907a0 commit 9cc444f
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 0 deletions.
5 changes: 5 additions & 0 deletions t/t4018/cpp-class-constructor
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Item::Item(int RIGHT)
{
ChangeMe;
broken;
}
6 changes: 6 additions & 0 deletions t/t4018/cpp-class-constructor-mem-init
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Item::Item(int RIGHT) :
member(0)
{
ChangeMe;
broken;
}
5 changes: 5 additions & 0 deletions t/t4018/cpp-class-destructor
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
RIGHT::~RIGHT()
{
ChangeMe;
broken;
}
5 changes: 5 additions & 0 deletions t/t4018/cpp-function-returning-global-type
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
::Item get::it::RIGHT()
{
ChangeMe;
broken;
}
6 changes: 6 additions & 0 deletions t/t4018/cpp-function-returning-nested
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
get::Item get::it::RIGHT()
{
ChangeMe;
broken;
}

5 changes: 5 additions & 0 deletions t/t4018/cpp-function-returning-reference
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
string& get::it::RIGHT(char *ptr)
{
ChangeMe;
broken;
}
6 changes: 6 additions & 0 deletions t/t4018/cpp-gnu-style-function
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const char *
RIGHT(int arg)
{
ChangeMe;
broken;
}
5 changes: 5 additions & 0 deletions t/t4018/cpp-namespace-definition
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace RIGHT
{
ChangeMe;
broken;
}
5 changes: 5 additions & 0 deletions t/t4018/cpp-operator-definition
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Value operator+(Value LEFT, Value RIGHT)
{
ChangeMe;
broken;
}
8 changes: 8 additions & 0 deletions t/t4018/cpp-struct-single-line
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
void wrong()
{
}

struct RIGHT_iterator_tag {};

int ChangeMe;
// broken
5 changes: 5 additions & 0 deletions t/t4018/cpp-template-function-definition
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
template<class T> int RIGHT(T arg)
{
ChangeMe;
broken;
}
5 changes: 5 additions & 0 deletions t/t4018/cpp-union-definition
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
union RIGHT {
double v;
int ChangeMe;
broken;
};

0 comments on commit 9cc444f

Please sign in to comment.