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 ------------
499 Plain directory enumeration
500 Plain directory enumeration from provided root
502 File enumeration from provided root
504 Mixed enumeration from provided root
505 With duplicates enumeration
506 Strip missing wildcards, keep unwildcarded names
541 ------ individual operations
557 0@or_broken@1073741824
558 0@or_broken@-1073741824
579 ------ precedence and grouping
582 @todo_wine@18@or_broken@10
583 @todo_wine@2@or_broken@0
584 @todo_wine@2@or_broken@0
587 @todo_wine@3@or_broken@4
588 ------ octal and hexadecimal
589 @todo_wine@3@or_broken@4
595 @todo_wine@3@or_broken@foo not defined
596 @todo_wine@3@or_broken@0
597 @todo_wine@3@or_broken@0
598 @todo_wine@3@or_broken@0
599 @todo_wine@9@or_broken@0
601 @todo_wine@4@or_broken@0
602 @todo_wine@-7@or_broken@0
603 @todo_wine@-1@or_broken@0
604 @todo_wine@5@or_broken@0
605 @todo_wine@4@or_broken@0
606 @todo_wine@1@or_broken@0
608 @todo_wine@5@or_broken@0
611 ------ string argument
617 ------ fileset argument
618 --------- basic blank handling
625 --------- multi-line with empty lines
629 --------- multiple files
658 ------------ Testing del /a ------------
659 not-r.test not found after delete, good
660 r.test found before delete, good
661 r.test not found after delete, good
662 ------------ Testing del /q ------------
663 del /q * succeeded on file1
664 del /q * succeeded on file2.dat
665 ------------ Testing del /s ------------
666 ------------ Testing rename ------------
667 --- ren and rename are synonymous
673 --- rename read-only files
674 read-only file renamed
675 --- rename directories
677 read-only dir renamed
678 --- rename in other directory
679 rename impossible in other directory
680 original file still present
681 ------------ Testing move ------------
684 @todo_wine@file move with overwrite succeeded@or_broken@file overwrite impossible!
685 @todo_wine@bar@or_broken@baz
686 read-only files are moveable
687 file moved in subdirectory
688 @todo_wine@moving a file to itself is a no-op@or_broken@moving a file to itself should be a no-op!
689 @todo_wine@ErrorLevel: 0@or_broken@ErrorLevel: 1
691 simple directory move succeeded
692 moving a directory to itself gives error; errlevel 1
693 ------ dir in dir move
697 ------------ Testing mkdir ------------
698 --- md and mkdir are synonymous
701 --- creating an already existing directory/file must fail
704 --- multilevel path creation
713 --- trailing backslashes
718 mkdir ? gives errorlevel 1
719 mkdir ?\foo gives errorlevel 1
720 mkdir foo\? gives errorlevel 1
722 mkdir foo\bar\? gives errorlevel 1
724 --- multiple directories at once
731 mkdir foo\* errorlevel 1
733 ------------ Testing rmdir ------------
742 non-empty dir not removed
744 non-empty dir not removed
745 recursive rmdir succeeded
746 recursive rmdir succeeded
751 ------------ Testing pushd/popd ------------
753 --- popd is no-op when dir stack is empty
755 --- pushing non-existing dir
766 ------------ Testing attrib ------------
767 A @pwd@\foobar\foo@or_broken@A @pwd@\foobar\foo@or_broken@A I @pwd@\foobar\foo
768 --- read-only attribute
769 A R @pwd@\foobar\foo@or_broken@A R @pwd@\foobar\foo@or_broken@A R I @pwd@\foobar\foo
771 foo original contents
772 Read-only file not deleted
773 Read-only file forcibly deleted
774 --- recursive behaviour
775 @todo_wine@A @pwd@\foobar\baz\level2@or_broken@A @pwd@\foobar\baz\level2@or_broken@A I @pwd@\foobar\baz\level2
776 @todo_wine@A R @pwd@\foobar\level1@or_broken@A R @pwd@\foobar\level1@or_broken@A R I @pwd@\foobar\level1
777 @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
778 A @pwd@\foobar\bar@or_broken@A @pwd@\foobar\bar@or_broken@A I @pwd@\foobar\bar
779 --- folders processing
780 @pwd@\foobar@or_broken@ @pwd@\foobar@or_broken@ I @pwd@\foobar
781 @todo_wine@ R @pwd@\foobar\baz@or_broken@ R @pwd@\foobar\baz@or_broken@ @pwd@\foobar\baz@or_broken@ R I @pwd@\foobar\baz
782 @todo_wine@A @pwd@\foobar\baz\toto@or_broken@A @pwd@\foobar\baz\toto@or_broken@A I @pwd@\foobar\baz\toto
785 file created in read-only dir
786 ------------ Testing assoc ------------
787 --- setting association
793 --- resetting association
797 ------------ Testing ftype ------------
798 --- setting association
805 --- resetting association
806 @todo_wine@original value@or_broken@buggyXP@or_broken@!FOO!
807 ------------ Testing CALL ------------
817 --- internal routines
827 @todo_wine@foo created
828 @todo_wine@Should expand foobaz
834 ------------ Testing SHIFT ------------
835 'p1' 'p2' 'p3' 'p4' 'p5'
836 'p2' 'p3' 'p4' 'p5' ''
841 ------------ Testing cmd invocation ------------
842 --- a batch file can delete itself
843 file correctly deleted
844 --- a batch file can alter itself
846 ------------ Testing setlocal/endlocal ------------
847 --- enable/disable extensions
848 @todo_wine@ErrLev:@space@
851 @todo_wine@ErrLev:@space@@or_broken@ErrLev: 0
853 --- setlocal with corresponding endlocal
858 --- setlocal with no corresponding endlocal
862 ------------ Testing Errorlevel ------------
865 errorlevel just right, good
866 errorlevel with leading zero just right, good
867 errorlevel with negative number OK
868 abc0def@or_broken@abc1def
869 errorlevel zero, good@or_broken@errorlevel nonzero, bad
872 ------------ Testing GOTO ------------
873 goto with no leading space worked
874 goto with a leading space worked
875 goto with a leading tab worked
876 goto with a following space worked
877 ------------ Testing PATH ------------
881 ------------ Testing combined CALLs/GOTOs ------------