Skip to content

Commit 3725078

Browse files
authored
Merge pull request #3566 from masatake/dont-test-version-number
Tmain: reduce hardcoded version number strings: "5.9.0"
2 parents 79df67d + 0b4be5e commit 3725078

File tree

35 files changed

+100
-41
lines changed

35 files changed

+100
-41
lines changed

Tmain/input-encoding-option.d/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ if ${CTAGS} --quiet --options=NONE --list-features | grep -q iconv; then
1414
check_encoding utf-8
1515
if ${CTAGS} --quiet --options=NONE \
1616
--pseudo-tags=-TAG_PROC_CWD \
17+
--pseudo-tags=-TAG_PROGRAM_VERSION \
1718
--pseudo-tags=-TAG_KIND_DESCRIPTION \
1819
--pseudo-tags=-TAG_EXTRA_DESCRIPTION \
1920
--pseudo-tags=-TAG_FIELD_DESCRIPTION \

Tmain/input-encoding-option.d/tags-expected.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
!_TAG_PROGRAM_AUTHOR Universal Ctags Team //
99
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
1010
!_TAG_PROGRAM_URL https://ctags.io/ /official site/
11-
!_TAG_PROGRAM_VERSION 5.9.0 //
1211
Foo input.java /^ public Foo() { \/\/ コンストラクタ$/;" m class:Foo
1312
Foo input.java /^class Foo { \/\/ Fooクラス$/;" c
1413
a input.js /^var a = 1; \/\/ 変数初期化$/;" v

Tmain/interactive-mode.d/run.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,39 @@ s()
1313
}
1414

1515
CTAGS="$CTAGS --options=NONE"
16+
NV="--pseudo-tags=-TAG_PROGRAM_VERSION"
1617

1718
echo identification message on startup
1819
echo =======================================
19-
${CTAGS} --_interactive < /dev/null |s
20+
${CTAGS} --_interactive $NV < /dev/null |s
2021

2122
echo
2223
echo error on invalid command
2324
echo =======================================
24-
echo '{"command":"foobar"}' | ${CTAGS} --_interactive |s
25+
echo '{"command":"foobar"}' | ${CTAGS} --_interactive $NV |s
2526

2627
echo
2728
echo error on missing arguments
2829
echo =======================================
29-
echo '{"command":"generate-tags"}' | ${CTAGS} --_interactive |s
30+
echo '{"command":"generate-tags"}' | ${CTAGS} --_interactive $NV |s
3031

3132
echo
3233
echo error on invalid file
3334
echo =======================================
34-
echo '{"command":"generate-tags", "filename":"test.foo"}' | ${CTAGS} --_interactive |s
35+
echo '{"command":"generate-tags", "filename":"test.foo"}' | ${CTAGS} --_interactive $NV |s
3536

3637
echo
3738
echo generate tags from file
3839
echo =======================================
39-
echo '{"command":"generate-tags", "filename":"test.rb"}' | ${CTAGS} --_interactive |s
40+
echo '{"command":"generate-tags", "filename":"test.rb"}' | ${CTAGS} --_interactive $NV |s
4041

4142
echo
4243
echo process multiple commands
4344
echo =======================================
4445
(
4546
echo '{"command":"generate-tags", "filename":"test.rb"}'
4647
echo '{"command":"generate-tags", "filename":"test.c"}'
47-
) | ${CTAGS} --_interactive |s
48+
) | ${CTAGS} --_interactive $NV |s
4849

4950
echo
5051
echo generate tags from data
@@ -53,4 +54,4 @@ size=$(filesize test.rb)
5354
(
5455
echo '{"command":"generate-tags", "filename":"foobar.rb", "size":'$size'}'
5556
cat test.rb
56-
) | ${CTAGS} --_interactive |s
57+
) | ${CTAGS} --_interactive $NV |s

Tmain/interactive-mode.d/stdout-expected.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
identification message on startup
22
=======================================
3-
{"_type": "program", "name": "Universal Ctags", "version": "5.9.0"}
3+
{"_type": "program", "name": "Universal Ctags"}
44

55
error on invalid command
66
=======================================
7-
{"_type": "program", "name": "Universal Ctags", "version": "5.9.0"}
7+
{"_type": "program", "name": "Universal Ctags"}
88
{"_type": "error", "message": "unknown command name", "fatal": true}
99

1010
error on missing arguments
1111
=======================================
12-
{"_type": "program", "name": "Universal Ctags", "version": "5.9.0"}
12+
{"_type": "program", "name": "Universal Ctags"}
1313
{"_type": "error", "message": "invalid generate-tags request", "fatal": true}
1414

1515
error on invalid file
1616
=======================================
17-
{"_type": "program", "name": "Universal Ctags", "version": "5.9.0"}
17+
{"_type": "program", "name": "Universal Ctags"}
1818
{"_type": "error", "message": "cannot open input file \"test.foo\"", "warning": true, "errno": 2, "perror": "No such file or directory"}
1919
{"_type": "completed", "command": "generate-tags"}
2020

2121
generate tags from file
2222
=======================================
23-
{"_type": "program", "name": "Universal Ctags", "version": "5.9.0"}
23+
{"_type": "program", "name": "Universal Ctags"}
2424
{"_type": "tag", "name": "Test", "path": "test.rb", "pattern": "/^class Test$/", "kind": "class"}
2525
{"_type": "tag", "name": "foobar", "path": "test.rb", "pattern": "/^ def foobar$/", "kind": "method", "scope": "Test", "scopeKind": "class"}
2626
{"_type": "tag", "name": "baz", "path": "test.rb", "pattern": "/^ def baz(a=1)$/", "kind": "method", "scope": "Test", "scopeKind": "class"}
2727
{"_type": "completed", "command": "generate-tags"}
2828

2929
process multiple commands
3030
=======================================
31-
{"_type": "program", "name": "Universal Ctags", "version": "5.9.0"}
31+
{"_type": "program", "name": "Universal Ctags"}
3232
{"_type": "tag", "name": "Test", "path": "test.rb", "pattern": "/^class Test$/", "kind": "class"}
3333
{"_type": "tag", "name": "foobar", "path": "test.rb", "pattern": "/^ def foobar$/", "kind": "method", "scope": "Test", "scopeKind": "class"}
3434
{"_type": "tag", "name": "baz", "path": "test.rb", "pattern": "/^ def baz(a=1)$/", "kind": "method", "scope": "Test", "scopeKind": "class"}
@@ -39,7 +39,7 @@ process multiple commands
3939

4040
generate tags from data
4141
=======================================
42-
{"_type": "program", "name": "Universal Ctags", "version": "5.9.0"}
42+
{"_type": "program", "name": "Universal Ctags"}
4343
{"_type": "tag", "name": "Test", "path": "foobar.rb", "pattern": "/^class Test$/", "kind": "class"}
4444
{"_type": "tag", "name": "foobar", "path": "foobar.rb", "pattern": "/^ def foobar$/", "kind": "method", "scope": "Test", "scopeKind": "class"}
4545
{"_type": "tag", "name": "baz", "path": "foobar.rb", "pattern": "/^ def baz(a=1)$/", "kind": "method", "scope": "Test", "scopeKind": "class"}

Tmain/interactive-notice-output.d/run.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ s()
1212
}
1313

1414
if is_feature_available ${CTAGS} json; then
15-
echo '{"command":"generate-tags", "filename":"input.cst"}' | $CTAGS --options=NONE --map-CTagsSelfTest=.cst --_interactive |s
16-
echo '{"command":"generate-tags", "filename":"input.cst"}' | $CTAGS --quiet --options=NONE --map-CTagsSelfTest=.cst --_interactive |s
15+
echo '{"command":"generate-tags", "filename":"input.cst"}' | $CTAGS --options=NONE --pseudo-tags=-TAG_PROGRAM_VERSION \
16+
--map-CTagsSelfTest=.cst --_interactive |s
17+
echo '{"command":"generate-tags", "filename":"input.cst"}' | $CTAGS --quiet --options=NONE --pseudo-tags=-TAG_PROGRAM_VERSION \
18+
--map-CTagsSelfTest=.cst --_interactive |s
1719
fi
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{"_type": "program", "name": "Universal Ctags", "version": "5.9.0"}
1+
{"_type": "program", "name": "Universal Ctags"}
22
{"_type": "error", "message": "notice output for testing: triggerNotice", "notice": true}
33
{"_type": "completed", "command": "generate-tags"}
4-
{"_type": "program", "name": "Universal Ctags", "version": "5.9.0"}
4+
{"_type": "program", "name": "Universal Ctags"}
55
{"_type": "completed", "command": "generate-tags"}

Tmain/interactive-option-write-to-file.d/run.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ s()
1616

1717
O=/tmp/ctags-tmain-$$.txt
1818

19-
echo '{"command":"generate-tags", "filename":"test.rb"}' | ${CTAGS} --quiet --options=NONE --_interactive -o ${O} |s
19+
echo '{"command":"generate-tags", "filename":"test.rb"}' | ${CTAGS} --quiet --options=NONE --_interactive -o ${O} \
20+
--pseudo-tags=-TAG_PROGRAM_VERSION |s
2021

2122
rm -f ${O}

Tmain/interactive-option-write-to-file.d/stdout-expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{"_type": "program", "name": "Universal Ctags", "version": "5.9.0"}
1+
{"_type": "program", "name": "Universal Ctags"}
22
{"_type": "tag", "name": "Test", "path": "test.rb", "pattern": "/^class Test$/", "kind": "class"}
33
{"_type": "tag", "name": "foobar", "path": "test.rb", "pattern": "/^ def foobar$/", "kind": "method", "scope": "Test", "scopeKind": "class"}
44
{"_type": "tag", "name": "baz", "path": "test.rb", "pattern": "/^ def baz(a=1)$/", "kind": "method", "scope": "Test", "scopeKind": "class"}

Tmain/output-encoding-option.d/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ if ${CTAGS} --quiet --options=NONE --list-features | grep -q iconv; then
1313
check_encoding euc-jp
1414
if ${CTAGS} --quiet --options=NONE \
1515
--pseudo-tags=-TAG_PROC_CWD \
16+
--pseudo-tags=-TAG_PROGRAM_VERSION \
1617
--pseudo-tags=-TAG_KIND_DESCRIPTION \
1718
--pseudo-tags=-TAG_FIELD_DESCRIPTION \
1819
--pseudo-tags=-TAG_EXTRA_DESCRIPTION \

Tmain/output-encoding-option.d/tags-expected.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
!_TAG_PROGRAM_AUTHOR Universal Ctags Team //
99
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
1010
!_TAG_PROGRAM_URL https://ctags.io/ /official site/
11-
!_TAG_PROGRAM_VERSION 5.9.0 //
1211
Foo input.java /^ public Foo() { \/\/ �R���X�g���N�^$/;" m class:Foo
1312
Foo input.java /^class Foo { \/\/ Foo�N���X$/;" c
1413
a input.js /^var a = 1; \/\/ �ϐ�������$/;" v

0 commit comments

Comments
 (0)