summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2018-05-18 14:17:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-21 00:38:50 (GMT)
commit7d314073488ae81b8f5cdecb4d00a78529fa7dc3 (patch)
tree9cc5f1fef755f82d7320710bbce47f717c04adac /contrib
parent8b4c2e0b1c4ff47c07b2c1bbc937bb46e889755e (diff)
downloadgit-7d314073488ae81b8f5cdecb4d00a78529fa7dc3.zip
git-7d314073488ae81b8f5cdecb4d00a78529fa7dc3.tar.gz
git-7d314073488ae81b8f5cdecb4d00a78529fa7dc3.tar.bz2
t9902-completion: exercise __git_complete_index_file() directly
The tests added in 2f271cd9cf (t9902-completion: add tests demonstrating issues with quoted pathnames, 2018-05-08) and in 2ab6eab4fe (completion: improve handling quoted paths in 'git ls-files's output, 2018-03-28) have a few shortcomings: - All these tests use the 'test_completion' helper function, thus they are exercising the whole completion machinery, although they are only interested in how git-aware path completion, specifically the __git_complete_index_file() function deals with unusual characters in pathnames and on the command line. - These tests can't satisfactorily test the case of pathnames containing spaces, because 'test_completion' gets the words on the command line as a single argument and it uses space as word separator. - Some of the tests are protected by different FUNNYNAMES_* prereqs depending on whether they put backslashes and double quotes or separator characters (FS, GS, RS, US) in pathnames, although a filesystem not allowing one likely doesn't allow the others either. - One of the tests operates on paths containing '|' and '&' characters without being protected by a FUNNYNAMES prereq, but some filesystems (notably on Windows) don't allow these characters in pathnames, either. Replace these tests with basically equivalent, more focused tests that call __git_complete_index_file() directly. Since this function only looks at the current word to be completed, i.e. the $cur variable, we can easily include pathnames containing spaces in the tests, so use such pathnames instead of pathnames containing '|' and '&'. Finally, use only a single FUNNYNAMES prereq for all kinds of special characters. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
0 files changed, 0 insertions, 0 deletions