forked from universal-ctags/ctags
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tmain: add a case verifying ctags provides fields vista.vim expects
<REMOVE ME> This is an example for a test case verifying ctags satisfies an expection of a client tool. * See <https://docs.ctags.io/en/latest/tips.html#tmain-a-facility-for-testing-main-part> to write and run a test case for Tmain target. * Use `Tmain: ` as the prefix of the header of the commit log. * Put files composint a test case to Tmain/client-<the name of client>-<aspect of testing>.d/ . * Put a README Tmain/client-<the name of client>-<aspect of testing>.d/ in addition to putting the standard Tmain test files like run.sh. The README is the message to developers of u-ctags. * Don't include unessary white-spaces in README and run.sh. </REMOVE ME> <REMOVE ME: MY TODO> I must write this to our docs. </REMOVE ME: MY TODO>
- Loading branch information
Showing
5 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
If your change breaks this test case, notify the change | ||
to https://github.com/liuchengxu/vista.vim. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright: 2021 <YOUR NAME HERE:Please put your ame> | ||
# License: GPL-2 | ||
|
||
CTAGS=$1 | ||
|
||
. ../utils.sh | ||
|
||
fields=nksSaf | ||
|
||
char_expand() | ||
{ | ||
if test -n "$1"; then | ||
echo ${1:0:1} $(char_expand ${1:1}) | ||
fi | ||
} | ||
|
||
s=0 | ||
for x in $(char_expand nksSaf); do | ||
if ${CTAGS} --quiet --options=NONE --fields=+$x --_fatal-warnings /dev/null; then | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
masatake
Author
Owner
|
||
echo field $x is available. | ||
else | ||
echo field $x is not available. | ||
s=1 | ||
fi | ||
done | ||
|
||
exit $s |
Empty file.
6 changes: 6 additions & 0 deletions
6
Tmain/client-vista-vim-fields-expectation.d/stdout-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
field n is available. | ||
field k is available. | ||
field s is available. | ||
field S is available. | ||
field a is available. | ||
field f is available. |
To be honest, I don't quite understand this test. liuchengxu/vista.vim#386 is because
--fields=nksSaf
previously producesname
field but after some commit thename
field is missing, only with--fields=+nksSaf
thename
field gets back again. We should ensure the fields of the output of--fields=nksSaf
always stays the same.