Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added tests for Function::Parameters parser #2868

Merged
merged 3 commits into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Units/function-parameters.r/c-fp-test.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fun input.c /^int fun(void) $/;" f typeref:typename:int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A whitespace after (void) is not needed.

method input.c /^int method(void) $/;" f typeref:typename:int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A whitespace after (void) is not needed.

sub input.c /^int sub(void) $/;" f typeref:typename:int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A whitespace after (void) is not needed.

14 changes: 14 additions & 0 deletions Units/function-parameters.r/c-fp-test.d/input.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
int method(void)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...becase there is no whitespace after (void).

{
return 0;
}

int sub(void)
{
return 0;
}

int fun(void)
{
return 0;
}
4 changes: 4 additions & 0 deletions Units/function-parameters.r/perl-fp-test.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Jim::Butler input.pl /^package Jim::Butler;$/;" p
my_function input.pl /^fun my_function() {}$/;" f
my_method input.pl /^method my_method() {}$/;" m
my_subroutine input.pl /^sub my_subroutine {}$/;" s
11 changes: 11 additions & 0 deletions Units/function-parameters.r/perl-fp-test.d/input.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package Jim::Butler;

use Function::Parameters;

method my_method() {}

fun my_function() {}

sub my_subroutine {}

1;
3 changes: 3 additions & 0 deletions Units/function-parameters.r/python-fp-test.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fun input.py /^def fun():$/;" f
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctags never runs Perl parser ( and FunctionParameter subparser ) for .py files.
So this test case doesn't make sense as a test case for FunctionParameter subparser.
This test case tests the main part of ctags.
Please remove this test case.

method input.py /^def method():$/;" f
sub input.py /^def sub():$/;" f
8 changes: 8 additions & 0 deletions Units/function-parameters.r/python-fp-test.d/input.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
def method():
pass

def fun():
pass

def sub():
pass