forked from parapluu/Concuerror
-
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.
parapluu#308 Add test for short names
- Loading branch information
1 parent
3632103
commit 97b079c
Showing
4 changed files
with
50 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
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
33 changes: 33 additions & 0 deletions
33
tests-real/suites/options/autocomplete/autocomplete_short.erl
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,33 @@ | ||
-module(autocomplete_short). | ||
|
||
-export([test/0]). | ||
|
||
-include_lib("stdlib/include/assert.hrl"). | ||
|
||
test() -> | ||
try | ||
main() | ||
catch | ||
C:R -> | ||
io:format(standard_error, "Class: ~p~nReason: ~p~n", [C, R]), | ||
halt(1) | ||
end. | ||
|
||
main() -> | ||
AutoOutput = os:cmd("./autocomplete_short.sh"), | ||
AutoTokens = string:tokens(AutoOutput, " \n"), | ||
Auto = usort(AutoTokens), | ||
|
||
OptionSpec = concuerror_options:getopt_spec_no_default(), | ||
OptsRaw = ["-" ++ [Short] || {_, Short, _, _, _} <- OptionSpec, Short =/= undefined], | ||
Opts = usort(lists:sort(OptsRaw)), | ||
|
||
io:format(standard_error, "Auto - Opts : ~p~n", [Auto -- Opts]), | ||
io:format(standard_error, "Opts - Auto : ~p~n", [Opts -- Auto]), | ||
|
||
?assertEqual(Opts, Auto). | ||
|
||
usort(List) -> | ||
USort = lists:usort(List), | ||
?assertEqual(USort, List), | ||
USort. |
11 changes: 11 additions & 0 deletions
11
tests-real/suites/options/autocomplete/autocomplete_short.sh
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,11 @@ | ||
#!/bin/bash | ||
|
||
# load bash-completion functions | ||
source $(dirname $0)/../../../../resources/bash_completion/concuerror | ||
|
||
COMP_WORDS=(concuerror -) | ||
COMP_CWORD=1 | ||
|
||
_concuerror ignored - concuerror | ||
|
||
echo ${COMPREPLY[@]} |