2 @pwd@>echo Tests for cmd's builtin commands@space@
3 Tests for cmd's builtin commands
5 @pwd@>echo ------------ Testing 'echo' [ON] ------------@space@
6 ------------ Testing 'echo' [ON] ------------
11 @pwd@>echo 'singlequotedword'@space@
14 @pwd@>echo "doublequotedword"@space@
18 @pwd@>echo "/?"@space@
30 @pwd@>echo .word@space@
42 @pwd@>echo :word@space@
45 @pwd@>echo off now@space@
48 @pwd@>echo word@space@@space@
51 @pwd@>echo word@space@@space@@space@
54 @pwd@>echo word@space@
57 @pwd@>echo@tab@word@space@
60 @pwd@>echo@tab@word@space@@tab@@space@
63 @pwd@>echo@tab@word@tab@@space@@space@
66 @pwd@>echo word@space@
69 @pwd@>echo@space@@tab@word@space@
72 @pwd@>echo@space@@space@@tab@word@space@
75 @pwd@>echo@tab@@tab@word@space@
78 @pwd@>echo @tab@ on @space@@space@
82 ------------ Testing 'echo' [OFF] ------------
107 ------------ Testing mixed echo modes ------------
115 @todo_wine@@pwd@>if 1 == 1 echo foo@space@
118 @todo_wine@@pwd@>if 1 == 1@space@
122 ------------ Testing parameterization ------------
130 'a[b]{c}(d)e', '', ''
136 ------------ Testing rem ------------
138 @pwd@>rem Hello@space@
140 @pwd@>rem Hello@space@
142 @pwd@>rem Hello || foo@space@
144 @pwd@>rem echo lol@space@
146 @pwd@>rem echo foo & echo bar@space@
148 @pwd@>rem @tab@ Hello@space@
150 @pwd@>rem@tab@ Hello@space@
152 @pwd@>rem@tab@echo foo & echo bar@space@
153 ------------ Testing redirection operators ------------
154 --- stdout redirection
160 foo7@space@@or_broken@foo@tab@
161 foo9@space@@or_broken@foo@tab@
182 @todo_wine@foo7@space@@space@@or_broken@not supported@space@
183 @todo_wine@foo@or_broken@not supported
184 --- redirections within IF statements
189 file does not exist, ok
202 ------------ Testing circumflex escape character ------------
228 ------------ Testing 'set' ------------
248 set "FOO=bar" should not include the quotes in the variable value
254 ------------ Testing variable expansion ------------
255 ~dp0 should be directory containing batch file
258 CD value @pwd@@or_broken@CD value@space@
274 ------------ Testing variable substrings ------------
278 @todo_wine@'ty'@or_broken@''
282 ''@or_broken@'qwerty'
284 ------------ Testing variable substitution ------------
292 @pwd@\C D@or_broken@%~ff
293 @pwd@\E@or_broken@%~ff
296 @path@@or_broken@%~pd
297 @path@@or_broken@%~pd
303 @todo_wine@'@drive@@shortpath@R S'@or_broken@''
304 @todo_wine@'@drive@@shortpath@T'@or_broken@''
305 @todo_wine@'@drive@@shortpath@ABCDEFGHIJK.LMNOP'@or_broken@''
306 @todo_wine@''@or_broken@'%~ai'
307 @todo_wine@''@or_broken@'%~ai'
308 @todo_wine@'--a------'@or_broken@'%~ai'
309 @todo_wine@''@or_broken@'%~ti'
310 @todo_wine@''@or_broken@'%~ti'
311 @todo_wine@''@or_broken@'%~zi'
312 @todo_wine@''@or_broken@'%~zi'
337 @todo_wine@'@drive@@shortpath@R S'@or_broken@''
338 @todo_wine@'@drive@@shortpath@T'@or_broken@''
339 @todo_wine@'@drive@@shortpath@ABCDEFGHIJK.LMNOP'@or_broken@''
348 ------------ Testing variable delayed expansion ------------
349 --- default mode (load-time expansion)
354 --- runtime (delayed) expansion mode
356 @todo_wine@foo@or_broken@!FOO!
358 @todo_wine@bar@or_broken@foo
363 --- using /V cmd flag
365 @todo_wine@foo@or_broken@!FOO!
368 ------------ Testing conditional execution ------------
369 --- unconditional ampersand
374 --- on success conditional and
375 @todo_wine@foo3 not created
378 --- on failure conditional or
381 @todo_wine@------------ Testing cd ------------
383 Current dir: @pwd@\foobar@or_broken@Current dir:@space@
399 ------------ Testing type ------------
401 @pwd@>type foobaz@space@
404 @pwd@>echo ---@space@
412 ------------ Testing NUL ------------
417 @todo_wine@foo created
418 ------------ Testing if/else ------------
419 if/else should work with blocks
422 if seems not to detect /c as parameter
423 Testing case sensitivity with and without /i option
424 if seems to default to case sensitivity
427 Testing string comparisons
432 Testing tabs handling
440 ------------ Testing for ------------
531 ------ individual operations
547 0@or_broken@1073741824
548 0@or_broken@-1073741824
569 ------ precedence and grouping
572 @todo_wine@18@or_broken@10
573 @todo_wine@2@or_broken@0
574 @todo_wine@2@or_broken@0
577 @todo_wine@3@or_broken@4
578 ------ octal and hexadecimal
579 @todo_wine@3@or_broken@4
585 @todo_wine@3@or_broken@foo not defined
586 @todo_wine@3@or_broken@0
587 @todo_wine@3@or_broken@0
588 @todo_wine@3@or_broken@0
589 @todo_wine@9@or_broken@0
591 @todo_wine@4@or_broken@0
592 @todo_wine@-7@or_broken@0
593 @todo_wine@-1@or_broken@0
594 @todo_wine@5@or_broken@0
595 @todo_wine@4@or_broken@0
596 @todo_wine@1@or_broken@0
598 @todo_wine@5@or_broken@0
601 ------ string argument
607 ------ fileset argument
608 --------- basic blank handling
615 --------- multi-line with empty lines
619 --------- multiple files
648 ------------ Testing del /a ------------
649 not-r.test not found after delete, good
650 r.test found before delete, good
651 r.test not found after delete, good
652 ------------ Testing del /q ------------
653 del /q * succeeded on file1
654 del /q * succeeded on file2.dat
655 ------------ Testing del /s ------------
656 ------------ Testing rename ------------
657 --- ren and rename are synonymous
663 --- rename read-only files
664 read-only file renamed
665 --- rename directories
667 read-only dir renamed
668 --- rename in other directory
669 rename impossible in other directory
670 original file still present
671 ------------ Testing move ------------
674 @todo_wine@file move with overwrite succeeded@or_broken@file overwrite impossible!
675 @todo_wine@bar@or_broken@baz
676 read-only files are moveable
677 file moved in subdirectory
678 @todo_wine@moving a file to itself is a no-op@or_broken@moving a file to itself should be a no-op!
679 @todo_wine@ErrorLevel: 0@or_broken@ErrorLevel: 1
681 simple directory move succeeded
682 moving a directory to itself gives error; errlevel 1
683 ------ dir in dir move
687 ------------ Testing mkdir ------------
688 --- md and mkdir are synonymous
691 --- creating an already existing directory/file must fail
694 --- multilevel path creation
703 --- trailing backslashes
708 mkdir ? gives errorlevel 1
709 mkdir ?\foo gives errorlevel 1
710 mkdir foo\? gives errorlevel 1
712 mkdir foo\bar\? gives errorlevel 1
714 --- multiple directories at once
721 mkdir foo\* errorlevel 1
723 ------------ Testing rmdir ------------
732 non-empty dir not removed
734 non-empty dir not removed
735 recursive rmdir succeeded
736 recursive rmdir succeeded
741 ------------ Testing pushd/popd ------------
743 --- popd is no-op when dir stack is empty
745 --- pushing non-existing dir
756 ------------ Testing attrib ------------
757 A @pwd@\foobar\foo@or_broken@A @pwd@\foobar\foo@or_broken@A I @pwd@\foobar\foo
758 --- read-only attribute
759 A R @pwd@\foobar\foo@or_broken@A R @pwd@\foobar\foo@or_broken@A R I @pwd@\foobar\foo
761 foo original contents
762 Read-only file not deleted
763 Read-only file forcibly deleted
764 --- recursive behaviour
765 @todo_wine@A @pwd@\foobar\baz\level2@or_broken@A @pwd@\foobar\baz\level2@or_broken@A I @pwd@\foobar\baz\level2
766 @todo_wine@A R @pwd@\foobar\level1@or_broken@A R @pwd@\foobar\level1@or_broken@A R I @pwd@\foobar\level1
767 @todo_wine@A R @pwd@\foobar\baz\level2@or_broken@A R @pwd@\foobar\baz\level2@or_broken@A R I @pwd@\foobar\baz\level2
768 A @pwd@\foobar\bar@or_broken@A @pwd@\foobar\bar@or_broken@A I @pwd@\foobar\bar
769 --- folders processing
770 @pwd@\foobar@or_broken@ @pwd@\foobar@or_broken@ I @pwd@\foobar
771 @todo_wine@ R @pwd@\foobar\baz@or_broken@ R @pwd@\foobar\baz@or_broken@ @pwd@\foobar\baz@or_broken@ R I @pwd@\foobar\baz
772 @todo_wine@A @pwd@\foobar\baz\toto@or_broken@A @pwd@\foobar\baz\toto@or_broken@A I @pwd@\foobar\baz\toto
775 file created in read-only dir
776 ------------ Testing assoc ------------
777 --- setting association
783 --- resetting association
787 ------------ Testing ftype ------------
788 --- setting association
795 --- resetting association
796 @todo_wine@original value@or_broken@buggyXP@or_broken@!FOO!
797 ------------ Testing CALL ------------
807 --- internal routines
817 @todo_wine@foo created
818 @todo_wine@Should expand foobaz
824 ------------ Testing SHIFT ------------
825 'p1' 'p2' 'p3' 'p4' 'p5'
826 'p2' 'p3' 'p4' 'p5' ''
831 ------------ Testing cmd invocation ------------
832 --- a batch file can delete itself
833 file correctly deleted
834 --- a batch file can alter itself
836 ------------ Testing setlocal/endlocal ------------
837 --- enable/disable extensions
838 @todo_wine@ErrLev:@space@
841 @todo_wine@ErrLev:@space@@or_broken@ErrLev: 0
843 --- setlocal with corresponding endlocal
848 --- setlocal with no corresponding endlocal
852 ------------ Testing Errorlevel ------------
855 errorlevel just right, good
856 errorlevel with leading zero just right, good
857 errorlevel with negative number OK
858 abc0def@or_broken@abc1def
859 errorlevel zero, good@or_broken@errorlevel nonzero, bad
862 ------------ Testing GOTO ------------
863 goto with no leading space worked
864 goto with a leading space worked
865 goto with a leading tab worked
866 goto with a following space worked
867 ------------ Testing PATH ------------
871 ------------ Testing combined CALLs/GOTOs ------------