Fix case-insensitive completion of buffer names

* test/src/minibuf-tests.el (test-try-completion-ignore-case):
New test, suggested by Stefan Monnier <>.

* src/minibuf.c (Ftry_completion): Don't treat strings that
are identical but for the case as if they were identical for
the purposes of not counting the same string twice.  This
fixes case-insensitive completion when all the candidates are
identical but for the letter-case.  (Bug#11339)
1 job for master in 90 minutes and 2 seconds (queued for 2 seconds)
Status Job ID Name Coverage
failed #4163


Name Stage Failure
test-all Test The script exceeded the maximum execution time set for the job
  GEN      lisp/eshell/eshell-tests.log
ELC lisp/faces-tests.elc
GEN lisp/faces-tests.log
ELC lisp/ffap-tests.elc
GEN lisp/ffap-tests.log
ELC lisp/filenotify-tests.elc
GEN lisp/filenotify-tests.log
Pulling docker image gitlab/gitlab-runner-helper:x86_64-d0b76032 ...
ERROR: Job failed: execution took longer than 1h30m0s seconds