run-file () { local spec_name=$1; shift; local spec_file=spec/$spec_name.test.sh; local suite; suite=$(test/sh_spec.py --print-spec-suite $spec_file); local spec_subdir; case $suite in osh) spec_subdir='osh-cpp' ;; ysh) spec_subdir='ysh-cpp' ;; *) die "Invalid suite $suite" ;; esac; local base_dir=_tmp/spec/$spec_subdir; mkdir -v -p $base_dir; sh-spec $spec_file --timeout 10 --oils-bin-dir $PWD/bin --oils-cpp-bin-dir $REPO_ROOT/_bin/cxx-asan --tsv-output $base_dir/${spec_name}.tsv "$@" } ysh-completion: spec test case results

Results for ysh-completion.test.sh

statusoshosh-cpp
pass 66
FAIL 66
total1212
caseoshosh-cppdescription
0pass pass compexport
1pass pass compexport with multi-line commands
2pass pass redirect completions are quoted
3pass pass dir completions have trailing slash
4pass pass complete -F strings are not quoted again
5FAIL FAIL complete -W quoting
detailsdetails
6FAIL FAIL filenames are completed
detailsdetails
7FAIL FAIL complete both -W and -F: words and functions
detailsdetails
8FAIL FAIL -o default is an "else action", when zero are shown
detailsdetails
9pass pass git completion space issue (disabled for old git, e.g. v2.17.1)
10FAIL FAIL Complete Filenames with bad characters
detailsdetails
11FAIL FAIL Complete Command with bad characters
detailsdetails
12 passed, 0 OK, 0 not implemented, 0 BUG, 6 failed, 0 timeouts, 0 cases skipped
6 failed under osh

Details on runs that didn't PASS

osh5 complete -W quoting

[osh stdout] Expected '"q2-argv can\\\\\'t "\n"q2-argv checkout "\n"q2-argv cherry "\n' Got '"q2-argv checkout "\n"q2-argv cherry "\n\n'

stdout:
"q2-argv checkout "
"q2-argv cherry "

stderr:
osh warning: complete -C not implemented
osh-cpp5 complete -W quoting

[osh-cpp stdout] Expected '"q2-argv can\\\\\'t "\n"q2-argv checkout "\n"q2-argv cherry "\n' Got '"q2-argv checkout "\n"q2-argv cherry "\n\n'

stdout:
"q2-argv checkout "
"q2-argv cherry "

stderr:
osh warning: complete -C not implemented
osh6 filenames are completed

[osh stdout] Expected '\nTODO: Is the order reversed? I guess this is file system order, which is\nnondeterministic. YSH can sort them\n\necho baz \necho bar \n' Got '"echo baz "\n"echo bar "\n'

stdout:
"echo baz "
"echo bar "
stderr:
osh-cpp6 filenames are completed

[osh-cpp stdout] Expected '\nTODO: Is the order reversed? I guess this is file system order, which is\nnondeterministic. YSH can sort them\n\necho baz \necho bar \n' Got '"echo baz "\n"echo bar "\n'

stdout:
"echo baz "
"echo bar "
stderr:
osh7 complete both -W and -F: words and functions

[osh stdout] Expected 'Hm they are kinda reversed, I want to fix that. This is true even in Python\nthough, weird.\n' Got '"GIT bean "\n"GIT ale "\n"GIT dill "\n"GIT corn "\n'

stdout:
"GIT bean "
"GIT ale "
"GIT dill "
"GIT corn "
stderr:
osh-cpp7 complete both -W and -F: words and functions

[osh-cpp stdout] Expected 'Hm they are kinda reversed, I want to fix that. This is true even in Python\nthough, weird.\n' Got '"GIT bean "\n"GIT ale "\n"GIT dill "\n"GIT corn "\n'

stdout:
"GIT bean "
"GIT ale "
"GIT dill "
"GIT corn "
stderr:
osh8 -o default is an "else action", when zero are shown

[osh stdout] Expected 'TODO\ngit\n', got '-- nothing registered\n"GIT _tmp/"\n"GIT file2 "\n"GIT file1 "\n-- func\n"GIT bar "\n"GIT foo "\n-- func default\n"GIT bar "\n"GIT foo "\n-- empty func default\n"GIT _tmp/"\n"GIT file2 "\n"GIT file1 "\n'

stdout:
-- nothing registered
"GIT _tmp/"
"GIT file2 "
"GIT file1 "
-- func
"GIT bar "
"GIT foo "
-- func default
"GIT bar "
"GIT foo "
-- empty func default
"GIT _tmp/"
"GIT file2 "
"GIT file1 "
stderr:
osh-cpp8 -o default is an "else action", when zero are shown

[osh-cpp stdout] Expected 'TODO\ngit\n', got '-- nothing registered\n"GIT _tmp/"\n"GIT file2 "\n"GIT file1 "\n-- func\n"GIT bar "\n"GIT foo "\n-- func default\n"GIT bar "\n"GIT foo "\n-- empty func default\n"GIT _tmp/"\n"GIT file2 "\n"GIT file1 "\n'

stdout:
-- nothing registered
"GIT _tmp/"
"GIT file2 "
"GIT file1 "
-- func
"GIT bar "
"GIT foo "
-- func default
"GIT bar "
"GIT foo "
-- empty func default
"GIT _tmp/"
"GIT file2 "
"GIT file1 "
stderr:
osh10 Complete Filenames with bad characters

[osh stdout] Expected 'TODO\n', got '"echo hello "\nb\'echo hi\\yffthere \'\n'

stdout:
"echo hello "
b'echo hi\yffthere '
stderr:
osh-cpp10 Complete Filenames with bad characters

[osh-cpp stdout] Expected 'TODO\n', got '"echo hello "\nb\'echo hi\\yffthere \'\n'

stdout:
"echo hello "
b'echo hi\yffthere '
stderr:
osh11 Complete Command with bad characters

[osh stdout] Expected 'TODO\n', got 'b\'echo "bad \\yff byte" fooz \'\nb\'echo "bad \\yff byte" foo \'\n'

stdout:
b'echo "bad \yff byte" fooz '
b'echo "bad \yff byte" foo '
stderr:
osh-cpp11 Complete Command with bad characters

[osh-cpp stdout] Expected 'TODO\n', got 'b\'echo "bad \\yff byte" fooz \'\nb\'echo "bad \\yff byte" foo \'\n'

stdout:
b'echo "bad \yff byte" fooz '
b'echo "bad \yff byte" foo '
stderr: