Skip to content

Commit 7389f42

Browse files
committed
Tmain: add a case for testing $nth and &nth fields value of readtags
Signed-off-by: Masatake YAMATO <[email protected]>
1 parent bd3bd43 commit 7389f42

File tree

6 files changed

+47
-0
lines changed

6 files changed

+47
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* ctags --options=NONE --sort=yes--kinds-C=+z --fields=+o output.tags */
2+
int z(int y, int x)
3+
{
4+
return 0;
5+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
2+
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
3+
!_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/
4+
!_TAG_OUTPUT_FILESEP slash /slash or backslash/
5+
!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
6+
!_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/
7+
!_TAG_PROC_CWD /home/jet/var/ctags-github/Tmain/readtags-qualifier-nth-field.d/ //
8+
!_TAG_PROGRAM_AUTHOR Universal Ctags Team //
9+
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
10+
!_TAG_PROGRAM_URL https://ctags.io/ /official site/
11+
!_TAG_PROGRAM_VERSION 5.9.0 //
12+
x input.c /^int z(int y, int x)$/;" z function:z typeref:typename:int file: nth:1
13+
y input.c /^int z(int y, int x)$/;" z function:z typeref:typename:int file: nth:0
14+
z input.c /^int z(int y, int x)$/;" f typeref:typename:int
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
3+
# Copyright: 2016 Masatake YAMATO
4+
# License: GPL-2
5+
6+
READTAGS=$3
7+
8+
. ../utils.sh
9+
10+
#V="valgrind --leak-check=full -v"
11+
V=
12+
13+
if ! [ -x "${READTAGS}" ]; then
14+
skip "no readtags"
15+
fi
16+
17+
if ! ( "${READTAGS}" -h | grep -q -e -Q ); then
18+
skip "no qualifier function in readtags"
19+
fi
20+
21+
${V} ${READTAGS} -e -t output.tags \
22+
-Q '(eq? $kind "z")' \
23+
-S '(<> $nth &nth)' \
24+
-F '(list $name ":" $nth #t)' \
25+
-l

Tmain/readtags-qualifier-nth-field.d/stderr-expected.txt

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
y:0
2+
x:1

0 commit comments

Comments
 (0)