diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index 1a1e136f75..f4cc35a403 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -192,6 +192,38 @@ rmdir bar cd .. rmdir foo echo %ErrorLevel% +rem Trailing backslashes +mkdir foo\\\\ +echo %ErrorLevel% +if exist foo (rmdir foo && echo dir created +) else ( echo dir not created ) +echo %ErrorLevel% +rem Invalid chars +mkdir ? +echo %ErrorLevel% +call :setError 0 +mkdir ?\foo +echo %ErrorLevel% +call :setError 0 +mkdir foo\? +echo %ErrorLevel% +if exist foo (rmdir foo && echo ok, foo created +) else ( echo foo not created ) +call :setError 0 +mkdir foo\bar\? +echo %ErrorLevel% +call :setError 0 +if not exist foo ( + echo bad, foo not created +) else ( + cd foo + if exist bar ( + echo ok, foo\bar created + rmdir bar + ) + cd .. + rmdir foo +) echo -----------Testing Errorlevel----------- rem nt 4.0 doesn't really support a way of setting errorlevel, so this is weak diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index a7116f7f3d..cfbc77674b 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -115,6 +115,15 @@ del /q * succeeded on file2.dat @todo_wine@1 0 0 +0 +dir created +0 +@todo_wine@1 +@todo_wine@1 +@todo_wine@1 +@todo_wine@ok, foo created +@todo_wine@1 +@todo_wine@ok, foo\bar created -----------Testing Errorlevel----------- 1 errorlevel just right, good