patch 9.1.2050: tests: Test_cd_completion may fail
Problem: tests: Test_cd_completion() may fail depending on the contents
of the root directory of the current drive on Windows.
readdir() may return a directory that cannot "cd" to, causing
this test to fail. An example of such a directory is
"System Volume Information" which only admin can "cd" to.
Solution: When determining the directory to use for testing, use the
directory that we actually "cd" to successfully.
In addition, directories with '$' in their names are also
excluded, as they are considered environment variables during
completion and do not work as expected.
Example: "$RECYCLE.BIN" (Muraoka Taro).
closes: #19078
Signed-off-by: Muraoka Taro <koron.kaoriya@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>