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 for testing broken --_paramdef-<LANG> option
Signed-off-by: Masatake YAMATO <[email protected]>
- Loading branch information
Showing
4 changed files
with
163 additions
and
2 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,75 @@ | ||
# Copyright: 2018 Masatake YAMATO | ||
# License: GPL-2 | ||
|
||
CTAGS="$1 --quiet --options=NONE" | ||
|
||
title() | ||
{ | ||
echo | ||
echo "$@" | ||
|
||
{ | ||
echo | ||
echo "$@" | ||
} 1>&2 | ||
} | ||
|
||
{ | ||
title '# echo unknown lang' | ||
${CTAGS} --_paramdef-NOSUCHLANG | ||
${CTAGS} --_paramdef-NOSUCHLANG=param,desc | ||
|
||
title '# no option value' | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY= | ||
|
||
title '# wrong char in a field name' | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY=: | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY=:abc | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY=:abc, | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY=:abc,description | ||
|
||
title '# empty parameter name' | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY=, | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY=,abc | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY=,abc, | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY=,abc,description | ||
|
||
title '# empty description' | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY=abc | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY=abc, | ||
|
||
title '# no input file' | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY=abc,desc | ||
|
||
title '# inject a flag separator' | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY='param,desc{foo}' --list-params=IMAGINARY | ||
|
||
title '# inject a broken flag separator(1)' | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY='param,desc{foo' --list-params=IMAGINARY | ||
|
||
title '# inject a broken flag separator(2)' | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY='param,desc{' --list-params=IMAGINARY | ||
|
||
title '# use a { in description (1)' | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY='param,desc\{' --list-params=IMAGINARY | ||
|
||
title '# use a { in description (2)' | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY='param,desc\{}' --list-params=IMAGINARY | ||
|
||
title '# use a \ in description' | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY='param,desc\\backslash' --list-params=IMAGINARY | ||
|
||
title '# description started from {' | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY='param,{' --list-params=IMAGINARY | ||
|
||
title '# description started from \{' | ||
${CTAGS} --langdef=IMAGINARY --_paramdef-IMAGINARY='param,\{' --list-params=IMAGINARY | ||
|
||
} > /tmp/ctags-tmain-$$.stdout 2>/tmp/ctags-tmain-$$.stderr | ||
|
||
sed -e 's/\.exe//g' < /tmp/ctags-tmain-$$.stdout | ||
rm /tmp/ctags-tmain-$$.stdout | ||
|
||
sed -e 's/\.exe//g' < /tmp/ctags-tmain-$$.stderr 1>&2 | ||
rm /tmp/ctags-tmain-$$.stderr |
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,46 @@ | ||
|
||
# echo unknown lang | ||
ctags: Unknown language "NOSUCHLANG" in "_paramdef-NOSUCHLANG" option | ||
ctags: Unknown language "NOSUCHLANG" in "_paramdef-NOSUCHLANG" option | ||
|
||
# no option value | ||
ctags: no parameter definition specified in "--_paramdef-IMAGINARY" option | ||
ctags: no parameter definition specified in "--_paramdef-IMAGINARY" option | ||
|
||
# wrong char in a field name | ||
ctags: no parameter description specified in "--_paramdef-IMAGINARY" option | ||
ctags: no parameter description specified in "--_paramdef-IMAGINARY" option | ||
ctags: unacceptable char as part of parameter name in "--_paramdef-IMAGINARY" option: ':' | ||
ctags: unacceptable char as part of parameter name in "--_paramdef-IMAGINARY" option: ':' | ||
|
||
# empty parameter name | ||
ctags: the parameter name in "--_paramdef-IMAGINARY" option is empty | ||
ctags: the parameter name in "--_paramdef-IMAGINARY" option is empty | ||
ctags: the parameter name in "--_paramdef-IMAGINARY" option is empty | ||
ctags: the parameter name in "--_paramdef-IMAGINARY" option is empty | ||
|
||
# empty description | ||
ctags: no parameter description specified in "--_paramdef-IMAGINARY" option | ||
ctags: parameter description in "--_paramdef-IMAGINARY" option is empty | ||
|
||
# no input file | ||
ctags: No files specified. Try "ctags --help". | ||
|
||
# inject a flag separator | ||
|
||
# inject a broken flag separator(1) | ||
ctags: Warning: long flags specifier opened with `{' is not closed `}': "{foo" | ||
|
||
# inject a broken flag separator(2) | ||
ctags: Warning: long flags specifier opened with `{' is not closed `}': "{" | ||
|
||
# use a { in description (1) | ||
|
||
# use a { in description (2) | ||
|
||
# use a \ in description | ||
|
||
# description started from { | ||
ctags: parameter description in "--_paramdef-IMAGINARY" option is empty | ||
|
||
# description started from \{ |
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,42 @@ | ||
|
||
# echo unknown lang | ||
|
||
# no option value | ||
|
||
# wrong char in a field name | ||
|
||
# empty parameter name | ||
|
||
# empty description | ||
|
||
# no input file | ||
|
||
# inject a flag separator | ||
#NAME DESCRIPTION | ||
param desc | ||
|
||
# inject a broken flag separator(1) | ||
#NAME DESCRIPTION | ||
param desc | ||
|
||
# inject a broken flag separator(2) | ||
#NAME DESCRIPTION | ||
param desc | ||
|
||
# use a { in description (1) | ||
#NAME DESCRIPTION | ||
param desc{ | ||
|
||
# use a { in description (2) | ||
#NAME DESCRIPTION | ||
param desc{} | ||
|
||
# use a \ in description | ||
#NAME DESCRIPTION | ||
param desc\backslash | ||
|
||
# description started from { | ||
|
||
# description started from \{ | ||
#NAME DESCRIPTION | ||
param { |
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