builtin-completion () { run-file builtin-completion "$@" } run-file () { local spec_name=$1; shift; sh-spec spec/$spec_name.test.sh --compare-shells --oils-bin-dir $PWD/bin "$@" } builtin-completion: spec test case results

Results for builtin-completion.test.sh

statusbashosh
pass 4445
N-I 10
BUG 30
FAIL 03
total4848
casebashoshdescription
0pass FAIL complete with no args and complete -p both print completion spec
details
1pass pass complete -F f is usage error
2BUG pass complete with nonexistent function
details
3BUG pass complete with no action
details
4pass pass -A function prints functions
5pass pass Invalid syntax
6pass pass how compgen calls completion functions
7pass pass complete -o -F (git)
8pass pass compopt with invalid syntax
9pass pass compopt fails when not in completion function
10pass pass compgen -f on invalid dir
11pass pass compgen -f
12pass pass compgen -v with local vars
13pass pass compgen -v on unknown var
14pass pass compgen -v P
15pass pass compgen -e with global/local exported vars
16pass pass compgen -e on known, but unexported, var
17pass pass compgen -e on unknown var
18pass pass compgen -e P
19pass pass compgen with actions: function / variable / file
20pass pass compgen with actions: alias, setopt
21pass pass compgen with actions: shopt
22pass pass compgen with action and suffix: helptopic
23pass pass compgen -A directory
24pass pass compgen -A file
25pass pass compgen -A user
26pass pass compgen -A command completes external commands
27pass pass compgen -A command completes functions and aliases
28pass pass compgen -A command completes builtins and keywords
29pass pass compgen -k shows the same keywords as bash
30N-I pass compgen -k shows Oils keywords too
details
31pass pass compgen -k completes reserved shell keywords
32pass pass -o filenames and -o nospace have no effect with compgen
33pass pass -o plusdirs and -o dirnames with compgen
34pass pass compgen -o default completes files and dirs
35pass pass compgen doesn't respect -X for user-defined functions
36pass pass compgen -W words -X filter
37pass pass compgen -f -X filter -- $cur
38pass pass compgen doesn't need shell quoting
39pass pass compgen -W 'one two three'
40pass pass compgen -W evaluates code in $()
41pass pass compgen -W uses IFS, and delimiters are escaped with \
42BUG pass Parse errors for compgen -W and complete -W
details
43pass pass Runtime errors for compgen -W
44pass FAIL Runtime errors for compgen -F func
details
45pass pass compgen -W '' cmd is not a usage error
46pass pass compgen -A builtin
47pass FAIL complete -C vs. compgen -C
details
89 passed, 0 OK, 1 not implemented, 3 BUG, 3 failed, 0 timeouts, 0 cases skipped
3 failed under osh

Details on runs that didn't PASS

osh0 complete with no args and complete -p both print completion spec

[osh stdout] Expected "complete -W 'foo bar' mycommand\ncomplete -W 'foo bar' mycommand\ncomplete -F myfunc other\n" Got ''
[osh status] Expected 0, got 2

stdout:
stderr: 
[Commands]
__fallback:
  ( )
  actions: FileSystemAction 
  extra: 
  else: 
  predicate: DefaultPredicate 
  prefix: 
  suffix: 
__first:
  ( )
  actions: FixedWordsAction DynamicStrDictAction DynamicProcDictAction FixedWordsAction FileSystemAction ExternalCommandAction 
  extra: 
  else: 
  predicate: DefaultPredicate 
  prefix: 
  suffix: 
[Patterns]

  complete -p
           ^~
[ stdin ]:7: 'complete' got invalid flag '-p'
bash2 complete with nonexistent function

stdout:
status=0
stderr:
bash3 complete with no action

stdout:
status=0
stderr:
bash30 compgen -k shows Oils keywords too

stdout:
--
stderr:
bash42 Parse errors for compgen -W and complete -W

stdout:
status=1
status=0
stderr:
bash: line 1: ${: bad substitution
osh44 Runtime errors for compgen -F func

[osh stdout] Expected 'status=1\n', got 'foo\nbar\nstatus=0\n'

stdout:
foo
bar
status=0
stderr:
    COMPREPLY+=( $(( 1 / 0 )) )  # FATAL, but we still have candidates
                       ^
[ stdin ]:3: Divide by zero
osh47 complete -C vs. compgen -C

[osh stdout] Expected 'foo\nbar\ncompgen=0\ncomplete=0\n', got 'compgen=1\ncomplete=0\n'

stdout:
compgen=1
complete=0
stderr:
osh warning: complete -C not implemented
osh warning: complete -C not implemented