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 parameterization ------------
127 'a[b]{c}(d)e', '', ''
133 ------------ Testing rem ------------
135 @pwd@>rem Hello@space@
137 @pwd@>rem Hello@space@
139 @pwd@>rem Hello || foo@space@
141 @pwd@>rem echo lol@space@
143 @pwd@>rem echo foo & echo bar@space@
145 @pwd@>rem @tab@ Hello@space@
147 @pwd@>rem@tab@ Hello@space@
149 @pwd@>rem@tab@echo foo & echo bar@space@
150 ------------ Testing redirection operators ------------
151 --- stdout redirection
157 foo7@space@@or_broken@foo@tab@
158 foo9@space@@or_broken@foo@tab@
179 @todo_wine@foo7@space@@space@@or_broken@not supported@space@
180 @todo_wine@foo@or_broken@not supported
181 --- redirections within IF statements
186 file does not exist, ok
199 ------------ Testing circumflex escape character ------------
225 ------------ Testing 'set' ------------
235 @todo_wine@FOOBAR= bar
236 @todo_wine@FOOBAR = baz2
245 set "FOO=bar" should not include the quotes in the variable value
251 ------------ Testing variable expansion ------------
252 ~dp0 should be directory containing batch file
255 CD value @pwd@@or_broken@CD value@space@
271 ------------ Testing variable substrings ------------
275 @todo_wine@'ty'@or_broken@''
279 ''@or_broken@'qwerty'
281 ------------ Testing variable substitution ------------
287 @pwd@\C D@or_broken@%~ff
288 @pwd@\E@or_broken@%~ff
291 @path@@or_broken@%~pd
292 @path@@or_broken@%~pd
298 @todo_wine@'@drive@@shortpath@R S'@or_broken@''
299 @todo_wine@'@drive@@shortpath@T'@or_broken@''
300 @todo_wine@'@drive@@shortpath@ABCDEFGHIJK.LMNOP'@or_broken@''
301 @todo_wine@''@or_broken@'%~ai'
302 @todo_wine@''@or_broken@'%~ai'
303 @todo_wine@'--a------'@or_broken@'%~ai'
304 @todo_wine@''@or_broken@'%~ti'
305 @todo_wine@''@or_broken@'%~ti'
306 @todo_wine@''@or_broken@'%~zi'
307 @todo_wine@''@or_broken@'%~zi'
332 @todo_wine@'@drive@@shortpath@R S'@or_broken@''
333 @todo_wine@'@drive@@shortpath@T'@or_broken@''
334 @todo_wine@'@drive@@shortpath@ABCDEFGHIJK.LMNOP'@or_broken@''
343 ------------ Testing variable delayed expansion ------------
344 --- default mode (load-time expansion)
349 --- runtime (delayed) expansion mode
351 @todo_wine@foo@or_broken@!FOO!
353 @todo_wine@bar@or_broken@foo
358 --- using /V cmd flag
360 @todo_wine@foo@or_broken@!FOO!
363 ------------ Testing conditional execution ------------
364 --- unconditional ampersand
369 --- on success conditional and
370 @todo_wine@foo3 not created
373 --- on failure conditional or
376 @todo_wine@------------ Testing cd ------------
378 Current dir: @pwd@\foobar@or_broken@Current dir:@space@
394 ------------ Testing type ------------
396 @pwd@>type foobaz@space@
399 @pwd@>echo ---@space@
407 ------------ Testing NUL ------------
412 @todo_wine@foo created
413 ------------ Testing if/else ------------
414 if/else should work with blocks
417 if seems not to detect /c as parameter
418 Testing case sensitivity with and without /i option
419 if seems to default to case sensitivity
422 Testing string comparisons
427 Testing tabs handling
435 ------------ Testing for ------------
526 ------ individual operations
542 0@or_broken@1073741824
543 0@or_broken@-1073741824
564 ------ precedence and grouping
567 @todo_wine@18@or_broken@10
568 @todo_wine@2@or_broken@0
569 @todo_wine@2@or_broken@0
572 @todo_wine@3@or_broken@4
573 ------ octal and hexadecimal
574 @todo_wine@3@or_broken@4
580 @todo_wine@3@or_broken@foo not defined
581 @todo_wine@3@or_broken@0
582 @todo_wine@3@or_broken@0
583 @todo_wine@3@or_broken@0
584 @todo_wine@9@or_broken@0
586 @todo_wine@4@or_broken@0
587 @todo_wine@-7@or_broken@0
588 @todo_wine@-1@or_broken@0
589 @todo_wine@5@or_broken@0
590 @todo_wine@4@or_broken@0
591 @todo_wine@1@or_broken@0
593 @todo_wine@5@or_broken@0
596 ------ string argument
602 ------ fileset argument
603 --------- basic blank handling
610 --------- multi-line with empty lines
614 --------- multiple files
637 @todo_wine@foo bar baz
643 ------------ Testing del /a ------------
644 not-r.test not found after delete, good
645 r.test found before delete, good
646 r.test not found after delete, good
647 ------------ Testing del /q ------------
648 del /q * succeeded on file1
649 del /q * succeeded on file2.dat
650 ------------ Testing del /s ------------
651 ------------ Testing rename ------------
652 --- ren and rename are synonymous
658 --- rename read-only files
659 read-only file renamed
660 --- rename directories
662 read-only dir renamed
663 --- rename in other directory
664 rename impossible in other directory
665 original file still present
666 ------------ Testing move ------------
669 @todo_wine@file move with overwrite succeeded@or_broken@file overwrite impossible!
670 @todo_wine@bar@or_broken@baz
671 read-only files are moveable
672 file moved in subdirectory
673 @todo_wine@moving a file to itself is a no-op@or_broken@moving a file to itself should be a no-op!
674 @todo_wine@ErrorLevel: 0@or_broken@ErrorLevel: 1
676 simple directory move succeeded
677 moving a directory to itself gives error; errlevel 1
678 ------ dir in dir move
682 ------------ Testing mkdir ------------
683 --- md and mkdir are synonymous
686 --- creating an already existing directory/file must fail
689 --- multilevel path creation
698 --- trailing backslashes
703 mkdir ? gives errorlevel 1
704 mkdir ?\foo gives errorlevel 1
705 mkdir foo\? gives errorlevel 1
707 mkdir foo\bar\? gives errorlevel 1
709 --- multiple directories at once
716 mkdir foo\* errorlevel 1
718 ------------ Testing rmdir ------------
727 non-empty dir not removed
729 non-empty dir not removed
730 recursive rmdir succeeded
731 recursive rmdir succeeded
736 ------------ Testing pushd/popd ------------
738 --- popd is no-op when dir stack is empty
740 --- pushing non-existing dir
751 ------------ Testing attrib ------------
752 A @pwd@\foobar\foo@or_broken@A @pwd@\foobar\foo@or_broken@A I @pwd@\foobar\foo
753 --- read-only attribute
754 A R @pwd@\foobar\foo@or_broken@A R @pwd@\foobar\foo@or_broken@A R I @pwd@\foobar\foo
756 foo original contents
757 Read-only file not deleted
758 Read-only file forcibly deleted
759 --- recursive behaviour
760 @todo_wine@A @pwd@\foobar\baz\level2@or_broken@A @pwd@\foobar\baz\level2@or_broken@A I @pwd@\foobar\baz\level2
761 @todo_wine@A R @pwd@\foobar\level1@or_broken@A R @pwd@\foobar\level1@or_broken@A R I @pwd@\foobar\level1
762 @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
763 A @pwd@\foobar\bar@or_broken@A @pwd@\foobar\bar@or_broken@A I @pwd@\foobar\bar
764 --- folders processing
765 @pwd@\foobar@or_broken@ @pwd@\foobar@or_broken@ I @pwd@\foobar
766 @todo_wine@ R @pwd@\foobar\baz@or_broken@ R @pwd@\foobar\baz@or_broken@ @pwd@\foobar\baz@or_broken@ R I @pwd@\foobar\baz
767 @todo_wine@A @pwd@\foobar\baz\toto@or_broken@A @pwd@\foobar\baz\toto@or_broken@A I @pwd@\foobar\baz\toto
770 file created in read-only dir
771 ------------ Testing assoc ------------
772 --- setting association
778 --- resetting association
782 ------------ Testing ftype ------------
783 --- setting association
790 --- resetting association
791 @todo_wine@original value@or_broken@buggyXP@or_broken@!FOO!
792 ------------ Testing CALL ------------
802 --- internal routines
812 @todo_wine@foo created
813 @todo_wine@Should expand foobaz
819 ------------ Testing SHIFT ------------
820 'p1' 'p2' 'p3' 'p4' 'p5'
821 'p2' 'p3' 'p4' 'p5' ''
826 ------------ Testing cmd invocation ------------
827 --- a batch file can delete itself
828 file correctly deleted
829 --- a batch file can alter itself
831 ------------ Testing setlocal/endlocal ------------
832 --- enable/disable extensions
833 @todo_wine@ErrLev:@space@
836 @todo_wine@ErrLev:@space@@or_broken@ErrLev: 0
838 --- setlocal with corresponding endlocal
843 --- setlocal with no corresponding endlocal
847 ------------ Testing Errorlevel ------------
850 errorlevel just right, good
851 errorlevel with leading zero just right, good
852 errorlevel with negative number OK
853 abc0def@or_broken@abc1def
854 errorlevel zero, good@or_broken@errorlevel nonzero, bad
857 ------------ Testing GOTO ------------
858 goto with no leading space worked
859 goto with a leading space worked
860 goto with a leading tab worked
861 goto with a following space worked
862 ------------ Testing PATH ------------
866 ------------ Testing combined CALLs/GOTOs ------------