Zephir: add some tag parser tests

This commit is contained in:
Colomban Wendling 2014-05-15 18:08:25 +02:00
parent b1f93c2977
commit 4e0193d8f1
5 changed files with 45 additions and 0 deletions

View File

@ -212,6 +212,7 @@ test_sources = \
recursive.f95 \ recursive.f95 \
refcurs.sql \ refcurs.sql \
regexp.js \ regexp.js \
return-hint.zep \
secondary_fcn_name.js \ secondary_fcn_name.js \
semicolon.f90 \ semicolon.f90 \
shebang.js \ shebang.js \
@ -229,6 +230,7 @@ test_sources = \
simple.rb \ simple.rb \
simple.sh \ simple.sh \
simple.tcl \ simple.tcl \
simple.zep \
spurious_label_tags.c \ spurious_label_tags.c \
sql_single_quote.sql \ sql_single_quote.sql \
square_parens.f90 \ square_parens.f90 \

View File

@ -0,0 +1,14 @@
class Test
{
public function first(string str) -> string
{
function nested() {
}
}
public function second(int i) -> int
{
}
}

View File

@ -0,0 +1,5 @@
# format=tagmanager
TestÌ1Ö0
firstÌ16Í(string str)ÎTestÖ0
nestedÌ16Í()ÎTest::firstÖ0
secondÌ16Í(int i)ÎTestÖ0

19
tests/ctags/simple.zep Normal file
View File

@ -0,0 +1,19 @@
/* from http://zephir-lang.com/language.html */
namespace Test;
class MyClass
{
public function someMethod1()
{
int a = 1, b = 2;
return a + b;
}
public function someMethod2()
{
int a = 3, b = 4;
return a + b;
}
}

View File

@ -0,0 +1,5 @@
# format=tagmanager
MyClassÌ1ÎTestÖ0
TestÌ256Ö0
someMethod1Ì16Í()ÎTest::MyClassÖ0
someMethod2Ì16Í()ÎTest::MyClassÖ0