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 @todo_wine@@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 @todo_wine@@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@
79 ------------ Testing 'echo' [OFF] ------------
104 ------------ Testing mixed echo modes ------------
112 @todo_wine@@pwd@>if 1 == 1 echo foo@space@
115 @todo_wine@@pwd@>if 1 == 1@space@
119 ------------ Testing rem ------------
121 @pwd@>rem Hello@space@
123 @pwd@>rem Hello@space@
125 @pwd@>rem Hello || foo@space@
127 @pwd@>rem echo lol@space@
129 @pwd@>rem echo foo & echo bar@space@
131 @pwd@>rem @tab@ Hello@space@
133 @pwd@>rem@tab@ Hello@space@
135 @pwd@>rem@tab@echo foo & echo bar@space@
136 ------------ Testing redirection operators ------------
137 --- stdout redirection
143 foo7@space@@or_broken@foo@tab@
144 foo9@space@@or_broken@foo@tab@
162 @todo_wine@foo7@space@@space@@or_broken@not supported@space@
163 @todo_wine@foo@or_broken@not supported
164 --- redirections within IF statements
169 file does not exist, ok
182 ------------ Testing circumflex escape character ------------
183 @todo_wine@hello, world
184 @todo_wine@hello, world
185 @todo_wine@hell^o, world
186 @todo_wine@hell^o, world
189 @todo_wine@foo | echo bar
190 @todo_wine@foo & echo bar
197 @todo_wine@FOO=bar | baz
199 @todo_wine@FOO=bar ^| baz
202 ------------ Testing 'set' ------------
212 @todo_wine@FOOBAR= bar
213 @todo_wine@FOOBAR = baz2
222 set "FOO=bar" should not include the quotes in the variable value
228 ------------ Testing variable expansion ------------
229 ~dp0 should be directory containing batch file
232 CD value @pwd@@or_broken@CD value@space@
248 ------------ Testing variable substrings ------------
252 @todo_wine@'ty'@or_broken@''
256 ''@or_broken@'qwerty'
258 ------------ Testing variable substitution ------------
264 @pwd@\C D@or_broken@%~ff
265 @pwd@\E@or_broken@%~ff
268 @path@@or_broken@%~pd
269 @path@@or_broken@%~pd
275 @todo_wine@'@drive@@shortpath@R S'@or_broken@''
276 @todo_wine@'@drive@@shortpath@T'@or_broken@''
277 @todo_wine@'@drive@@shortpath@ABCDEFGHIJK.LMNOP'@or_broken@''
278 @todo_wine@''@or_broken@'%~ai'
279 @todo_wine@''@or_broken@'%~ai'
280 @todo_wine@'--a------'@or_broken@'%~ai'
281 @todo_wine@''@or_broken@'%~ti'
282 @todo_wine@''@or_broken@'%~ti'
283 @todo_wine@''@or_broken@'%~zi'
284 @todo_wine@''@or_broken@'%~zi'
296 @todo_wine@'A B'@or_broken@''
309 @todo_wine@'@drive@@shortpath@R S'@or_broken@''
310 @todo_wine@'@drive@@shortpath@T'@or_broken@''
311 @todo_wine@'@drive@@shortpath@ABCDEFGHIJK.LMNOP'@or_broken@''
320 ------------ Testing variable delayed expansion ------------
321 --- default mode (load-time expansion)
326 --- runtime (delayed) expansion mode
328 @todo_wine@foo@or_broken@!FOO!
330 @todo_wine@bar@or_broken@foo
335 --- using /V cmd flag
337 @todo_wine@foo@or_broken@!FOO!
340 ------------ Testing conditional execution ------------
341 --- unconditional ampersand
346 --- on success conditional and
347 @todo_wine@foo3 not created
350 --- on failure conditional or
353 @todo_wine@------------ Testing cd ------------
355 Current dir: @pwd@\foobar@or_broken@Current dir:@space@
369 ------------ Testing type ------------
371 @pwd@>type foobaz@space@
374 @pwd@>echo ---@space@
378 ------------ Testing NUL ------------
383 @todo_wine@foo created
384 ------------ Testing if/else ------------
385 if/else should work with blocks
388 if seems not to detect /c as parameter
389 Testing case sensitivity with and without /i option
390 if seems to default to case sensitivity
393 Testing string comparisons
398 Testing tabs handling
406 ------------ Testing for ------------
441 @todo_wine@"echo A B"
494 ------ individual operations
510 0@or_broken@1073741824
511 0@or_broken@-1073741824
532 ------ precedence and grouping
535 @todo_wine@18@or_broken@10
536 @todo_wine@2@or_broken@0
537 @todo_wine@2@or_broken@0
540 @todo_wine@3@or_broken@4
541 ------ octal and hexadecimal
542 @todo_wine@3@or_broken@4
548 @todo_wine@3@or_broken@foo not defined
549 @todo_wine@3@or_broken@0
550 @todo_wine@3@or_broken@0
551 @todo_wine@3@or_broken@0
552 @todo_wine@9@or_broken@0
554 @todo_wine@4@or_broken@0
555 @todo_wine@-7@or_broken@0
556 @todo_wine@-1@or_broken@0
557 @todo_wine@5@or_broken@0
558 @todo_wine@4@or_broken@0
559 @todo_wine@1@or_broken@0
561 @todo_wine@5@or_broken@0
564 ------ string argument
570 ------ fileset argument
571 --------- basic blank handling
578 --------- multi-line with empty lines
582 --------- multiple files
605 @todo_wine@foo bar baz
611 ------------ Testing del /a ------------
612 not-r.test not found after delete, good
613 r.test found before delete, good
614 r.test not found after delete, good
615 ------------ Testing del /q ------------
616 del /q * succeeded on file1
617 del /q * succeeded on file2.dat
618 ------------ Testing del /s ------------
619 ------------ Testing rename ------------
620 --- ren and rename are synonymous
626 --- rename read-only files
627 read-only file renamed
628 --- rename directories
630 read-only dir renamed
631 --- rename in other directory
632 @todo_wine@rename impossible in other directory
633 @todo_wine@original file still present
634 ------------ Testing move ------------
637 @todo_wine@file move with overwrite succeeded@or_broken@file overwrite impossible!
638 @todo_wine@bar@or_broken@baz
639 read-only files are moveable
640 file moved in subdirectory
641 @todo_wine@moving a file to itself is a no-op@or_broken@moving a file to itself should be a no-op!
642 @todo_wine@ErrorLevel: 0@or_broken@ErrorLevel: 1
644 simple directory move succeeded
645 moving a directory to itself gives error; errlevel 1
646 ------ dir in dir move
650 ------------ Testing mkdir ------------
651 --- md and mkdir are synonymous
654 --- creating an already existing directory/file must fail
657 --- multilevel path creation
666 --- trailing backslashes
671 mkdir ? gives errorlevel 1
672 mkdir ?\foo gives errorlevel 1
673 mkdir foo\? gives errorlevel 1
675 mkdir foo\bar\? gives errorlevel 1
677 --- multiple directories at once
682 mkdir foo\* errorlevel 1
684 ------------ Testing rmdir ------------
693 non-empty dir not removed
695 non-empty dir not removed
696 recursive rmdir succeeded
697 recursive rmdir succeeded
702 ------------ Testing pushd/popd ------------
704 --- popd is no-op when dir stack is empty
706 --- pushing non-existing dir
717 ------------ Testing attrib ------------
718 A @pwd@\foobar\foo@or_broken@A @pwd@\foobar\foo@or_broken@A I @pwd@\foobar\foo
719 --- read-only attribute
720 A R @pwd@\foobar\foo@or_broken@A R @pwd@\foobar\foo@or_broken@A R I @pwd@\foobar\foo
722 foo original contents
723 Read-only file not deleted
724 Read-only file forcibly deleted
725 --- recursive behaviour
726 @todo_wine@A @pwd@\foobar\baz\level2@or_broken@A @pwd@\foobar\baz\level2@or_broken@A I @pwd@\foobar\baz\level2
727 @todo_wine@A R @pwd@\foobar\level1@or_broken@A R @pwd@\foobar\level1@or_broken@A R I @pwd@\foobar\level1
728 @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
729 A @pwd@\foobar\bar@or_broken@A @pwd@\foobar\bar@or_broken@A I @pwd@\foobar\bar
730 --- folders processing
731 @pwd@\foobar@or_broken@ @pwd@\foobar@or_broken@ I @pwd@\foobar
732 @todo_wine@ R @pwd@\foobar\baz@or_broken@ R @pwd@\foobar\baz@or_broken@ @pwd@\foobar\baz@or_broken@ R I @pwd@\foobar\baz
733 @todo_wine@A @pwd@\foobar\baz\toto@or_broken@A @pwd@\foobar\baz\toto@or_broken@A I @pwd@\foobar\baz\toto
736 file created in read-only dir
737 ------------ Testing assoc ------------
738 --- setting association
744 --- resetting association
748 ------------ Testing ftype ------------
749 --- setting association
756 --- resetting association
757 @todo_wine@original value@or_broken@buggyXP@or_broken@!FOO!
758 ------------ Testing CALL ------------
764 @todo_wine@foo ""@space@
765 @todo_wine@"" bar@space@
768 --- internal routines
778 @todo_wine@foo created
779 @todo_wine@Should expand foobaz
785 ------------ Testing SHIFT ------------
786 'p1' 'p2' 'p3' 'p4' 'p5'
787 'p2' 'p3' 'p4' 'p5' ''
792 ------------ Testing cmd invocation ------------
793 --- a batch file can delete itself
794 file correctly deleted
795 --- a batch file can alter itself
797 ------------ Testing setlocal/endlocal ------------
798 --- enable/disable extensions
799 @todo_wine@ErrLev:@space@
802 @todo_wine@ErrLev:@space@@or_broken@ErrLev: 0
804 --- setlocal with corresponding endlocal
809 --- setlocal with no corresponding endlocal
813 ------------ Testing Errorlevel ------------
816 errorlevel just right, good
817 errorlevel with leading zero just right, good
818 errorlevel with negative number OK
819 abc0def@or_broken@abc1def
820 errorlevel zero, good@or_broken@errorlevel nonzero, bad
823 ------------ Testing GOTO ------------
824 goto with no leading space worked
825 goto with a leading space worked
826 goto with a leading tab worked
827 goto with a following space worked
828 ------------ Testing combined CALLs/GOTOs ------------