Thread (13 messages) flat view 13 messages, 3 authors, 2016-06-15

Re: [PATCH v2] tests: add initial bash completion tests

From: SZEDER Gábor <hidden>
Date: 2016-06-15 22:53:36

Hi,


I picked up Stephen Boyd's two-patch series[1] to use parse-options to
generate options for git commands, and the following test promply
failed (taken from 5c293a6b (tests: add initial bash completion tests,
2012-04-12)):

test_expect_success 'double dash "git checkout"' '
        sed -e "s/Z$//" >expected <<-\EOF &&
        --quiet Z
        --ours Z
        --theirs Z
        --track Z
        --no-track Z
        --merge Z
        --conflict=
        --orphan Z
        --patch Z
        EOF
        test_completion "git checkout --"
'

Not surprising, the completion script doesn't know about many 'git
checkout' long options.  So whenever 'git checkout' learns a new long
option, this list must be updated.  This won't be more work than the
update of the completion script, so this is probably OK.

But it got me thinking about what do we actually want to test here?
Whether the completion script returns the right long options in a
specific order upon 'git checkout --<TAB>'?  Or whether _git() works
properly and invokes the right command-specific completion function?
Or whether regular options get a trailing space while options
expecting an argument don't?  Or is this sort of an integration test
and basically all of the above?


[1] - http://thread.gmane.org/gmane.comp.version-control.git/195158/focus=195158

Best,
Gábor
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help