-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
serg-v
committed
Jan 22, 2023
1 parent
1af8274
commit 5e210f0
Showing
8 changed files
with
81 additions
and
10 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
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,4 @@ | ||
Run | ||
``` | ||
runtest --outdir log --tool completion | ||
``` |
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,30 @@ | ||
exp_internal 1 | ||
set timeout 1 | ||
|
||
proc run_completion_test {cmd test candidates} { | ||
send "${cmd}\t" | ||
expect { | ||
-re "(\n${candidates}\u001b)" { pass $test } | ||
timeout { fail $test } | ||
} | ||
puts "###Output" | ||
puts "$expect_out(1,string)" | ||
send "\x03" | ||
expect ">" | ||
} | ||
|
||
set cmd "basicExample -" | ||
set test "Tab should show options for '$cmd'" | ||
set candidates "-t -u --timeout --timeUnit --timeUnit=" | ||
run_completion_test $cmd $test $candidates | ||
|
||
set cmd "basicExample --" | ||
set test "Tab should show options for '$cmd'" | ||
set candidates "--timeout --timeUnit --timeUnit=" | ||
run_completion_test $cmd $test $candidates | ||
|
||
set cmd "basicExample --timeUnit=" | ||
set test "Tab should show time unit enum values for '$cmd'" | ||
#set candidates "1 2 3" | ||
set candidates "\u2026timeUnit=DAYS \u2026timeUnit=MICROSECONDS \u2026timeUnit=MINUTES \u2026timeUnit=SECONDS\r\n\u2026timeUnit=HOURS \u2026timeUnit=MILLISECONDS \u2026timeUnit=NANOSECONDS " | ||
run_completion_test $cmd $test $candidates |
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,8 @@ | ||
exp_spawn fish --no-config | ||
expect -re "(.+>)" | ||
|
||
send "source ../resources/basic.fish\r" | ||
expect -re "(.+>)" | ||
|
||
send "function basicExample; echo 'do'; end\r" | ||
expect -re "(.+>)" |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
# root completion | ||
set -l root | ||
complete -c basicExample -n "not __fish_seen_subcommand_from $root" -l timeUnit -f -a 'NANOSECONDS MICROSECONDS MILLISECONDS SECONDS MINUTES HOURS DAYS' -d '' | ||
complete -c basicExample -n "not __fish_seen_subcommand_from $root" -s u -d '' | ||
complete -c basicExample -n "not __fish_seen_subcommand_from $root" -l timeout -d '' | ||
complete -c basicExample -n "not __fish_seen_subcommand_from $root" -s t -d '' |