patch 8.2.0049: command line completion not fully tested

Problem:    Command line completion not fully tested.
Solution:   Add more test cases.  Make help sorting stable. (Dominique Pelle,
            closes #5402)
diff --git a/src/testdir/test_cd.vim b/src/testdir/test_cd.vim
index bdb26cd..05d3877 100644
--- a/src/testdir/test_cd.vim
+++ b/src/testdir/test_cd.vim
@@ -106,3 +106,18 @@
   call chdir(topdir)
   call delete('Xdir', 'rf')
 endfunc
+
+func Test_cd_completion()
+  call mkdir('XComplDir1', 'p')
+  call mkdir('XComplDir2', 'p')
+  call writefile([], 'XComplFile')
+
+  for cmd in ['cd', 'chdir', 'lcd', 'lchdir', 'tcd', 'tchdir']
+    call feedkeys(':' .. cmd .. " XCompl\<C-A>\<C-B>\"\<CR>", 'tx')
+    call assert_equal('"' .. cmd .. ' XComplDir1/ XComplDir2/', @:)
+  endfor
+
+  call delete('XComplDir1', 'd')
+  call delete('XComplDir2', 'd')
+  call delete('XComplFile')
+endfunc