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@
77 ------------ Testing 'echo' [OFF] --------------
102 ------------ Testing mixed echo modes --------------
110 @todo_wine@@pwd@>if 1 == 1 echo foo@space@
113 @todo_wine@@pwd@>if 1 == 1@space@
117 ------------ Testing rem --------------
119 @pwd@>rem Hello@space@
121 @pwd@>rem Hello@space@
123 @pwd@>rem Hello || foo@space@
125 @pwd@>rem echo lol@space@
127 @pwd@>rem echo foo & echo bar@space@
129 @pwd@>rem @tab@ Hello@space@
131 @pwd@>rem@tab@ Hello@space@
133 @pwd@>rem@tab@echo foo & echo bar@space@
134 ------------ Testing redirection operators --------------
135 ...stdout redirection
141 foo7@space@@or_broken@foo@tab@
142 foo9@space@@or_broken@foo@tab@
160 @todo_wine@foo7@space@@space@@or_broken@not supported@space@
161 @todo_wine@foo@or_broken@not supported
162 ...redirections within IF statements
166 file does not exist, ok
179 @todo_wine@------------ Testing ^ escape character --------------
180 @todo_wine@hello, world
181 @todo_wine@hello, world
182 @todo_wine@hell^o, world
183 @todo_wine@hell^o, world
186 @todo_wine@foo | echo bar
187 @todo_wine@foo & echo bar
189 @todo_wine@baz@space@
190 @todo_wine@0@or_broken@1
194 @todo_wine@FOO=bar | baz
196 @todo_wine@FOO=bar ^| baz
199 ------------ Testing 'set' --------------
209 @todo_wine@FOOBAR= bar
210 @todo_wine@FOOBAR = baz2
219 set "FOO=bar" should not include the quotes in the variable value
225 ------------ Testing variable expansion --------------
226 ~dp0 should be directory containing batch file
229 CD value @pwd@@or_broken@CD value@space@
245 ------------ Testing variable substrings --------------
249 @todo_wine@'ty'@or_broken@''
253 ''@or_broken@'qwerty'
255 ------------ Testing variable substitution --------------
261 @pwd@\C D@or_broken@%~ff
262 @pwd@\E@or_broken@%~ff
265 @path@@or_broken@%~pd
266 @path@@or_broken@%~pd
272 @todo_wine@'@drive@@shortpath@R S'@or_broken@''
273 @todo_wine@'@drive@@shortpath@T'@or_broken@''
274 @todo_wine@'@drive@@shortpath@ABCDEFGHIJK.LMNOP'@or_broken@''
275 @todo_wine@''@or_broken@'%~ai'
276 @todo_wine@''@or_broken@'%~ai'
277 @todo_wine@'--a------'@or_broken@'%~ai'
278 @todo_wine@''@or_broken@'%~ti'
279 @todo_wine@''@or_broken@'%~ti'
280 @todo_wine@''@or_broken@'%~zi'
281 @todo_wine@''@or_broken@'%~zi'
293 @todo_wine@'A B'@or_broken@''
306 @todo_wine@'@drive@@shortpath@R S'@or_broken@''
307 @todo_wine@'@drive@@shortpath@T'@or_broken@''
308 @todo_wine@'@drive@@shortpath@ABCDEFGHIJK.LMNOP'@or_broken@''
317 ------------ Testing variable delayed expansion --------------
318 ...default mode (load-time expansion)
323 ...runtime (delayed) expansion mode
325 @todo_wine@foo@or_broken@!FOO!
327 @todo_wine@bar@or_broken@foo
334 @todo_wine@foo@or_broken@!FOO!
337 ------------ Testing conditional execution --------------
338 @todo_wine@...unconditional &
343 @todo_wine@...on success conditional &&
344 @todo_wine@foo3 not created
347 @todo_wine@...on failure conditional ||
349 @todo_wine@foo6@space@
350 ------------ Testing cd ------------
352 Current dir: @pwd@\foobar@or_broken@Current dir:@space@
366 ------------ Testing type ------------
368 @pwd@>type foobaz@space@
371 @pwd@>echo ***@space@
375 ------------ Testing NUL ------------
380 @todo_wine@foo created
381 ------------ Testing if/else --------------
382 if/else should work with blocks
385 if seems not to detect /c as parameter
386 Testing case sensitivity with and without /i option
387 if seems to default to case sensitivity
390 Testing string comparisons
395 Testing tabs handling
403 -----------Testing for -----------
438 @todo_wine@"echo A B"
469 @todo_wine@ErrorLevel 0
470 @todo_wine@ErrorLevel 0
472 ......individual operations
488 0@or_broken@1073741824
489 0@or_broken@-1073741824
510 ......precedence and grouping
513 @todo_wine@18@or_broken@10
514 @todo_wine@2@or_broken@0
515 @todo_wine@2@or_broken@0
518 @todo_wine@3@or_broken@4
519 ......octal and hexadecimal
520 @todo_wine@3@or_broken@4
526 @todo_wine@3@or_broken@foo not defined
527 @todo_wine@3@or_broken@0
528 @todo_wine@3@or_broken@0
529 @todo_wine@3@or_broken@0
530 @todo_wine@9@or_broken@0
532 @todo_wine@4@or_broken@0
533 @todo_wine@-7@or_broken@0
534 @todo_wine@-1@or_broken@0
535 @todo_wine@5@or_broken@0
536 @todo_wine@4@or_broken@0
537 @todo_wine@1@or_broken@0
539 @todo_wine@5@or_broken@0
542 ......string argument
548 ......fileset argument
549 .........basic blank handling
556 .........multi-line with empty lines
560 .........multiple files
583 @todo_wine@foo bar baz
589 -----------Testing del /a-----------
590 not-r.test not found after delete, good
591 r.test found before delete, good
592 r.test not found after delete, good
593 ------------ Testing del /q --------------
594 del /q * succeeded on file1
595 del /q * succeeded on file2.dat
596 ------------ Testing del /s --------------
597 ------------ Testing rename ------------
598 ... ren and rename are synonymous ...
601 ... name collision ...
604 ... rename in other directory ...
605 @todo_wine@rename impossible in other directory
606 @todo_wine@original file still present
607 ------------ Testing mkdir ------------
608 ... md and mkdir are synonymous ...
611 ... creating an already existing directory/file must fail ...
614 ... multilevel path creation ...
623 ... trailing backslashes ...
627 ... invalid chars ...
628 mkdir ? gives errorlevel 1
629 mkdir ?\foo gives errorlevel 1
630 mkdir foo\? gives errorlevel 1
632 mkdir foo\bar\? gives errorlevel 1
634 ... multiple directories at once ...
639 mkdir foo\* errorlevel 1
641 ----------- Testing rmdir -----------
650 non-empty dir not removed
652 non-empty dir not removed
653 recursive rmdir succeeded
654 recursive rmdir succeeded
659 ----------- Testing pushd/popd -----------
661 ...popd is no-op when dir stack is empty
663 ...pushing non-existing dir
674 ------------ Testing attrib --------------
675 @todo_wine@A @pwd@\foobar\foo@or_broken@A @pwd@\foobar\foo@or_broken@A I @pwd@\foobar\foo
676 ... read-only attribute
677 @todo_wine@A R @pwd@\foobar\foo@or_broken@A R @pwd@\foobar\foo@or_broken@A R I @pwd@\foobar\foo
679 foo original contents
680 Read-only file not deleted
681 Read-only file forcibly deleted
682 ... recursive behaviour
683 @todo_wine@A @pwd@\foobar\baz\level2@or_broken@A @pwd@\foobar\baz\level2@or_broken@A I @pwd@\foobar\baz\level2
684 @todo_wine@A R @pwd@\foobar\level1@or_broken@A R @pwd@\foobar\level1@or_broken@A R I @pwd@\foobar\level1
685 @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
686 @todo_wine@A @pwd@\foobar\bar@or_broken@A @pwd@\foobar\bar@or_broken@A I @pwd@\foobar\bar
687 ... folders processing
688 @todo_wine@ @pwd@\foobar@or_broken@ @pwd@\foobar@or_broken@ I @pwd@\foobar
689 @todo_wine@ R @pwd@\foobar\baz@or_broken@ R @pwd@\foobar\baz@or_broken@ @pwd@\foobar\baz@or_broken@ R I @pwd@\foobar\baz
690 @todo_wine@A @pwd@\foobar\baz\toto@or_broken@A @pwd@\foobar\baz\toto@or_broken@A I @pwd@\foobar\baz\toto
693 file created in read-only dir
694 ------------ Testing assoc --------------
695 ...setting association
701 ...resetting association
705 ------------ Testing ftype --------------
706 ...setting association
713 ...resetting association
714 @todo_wine@original value@or_broken@buggyXP@or_broken@!FOO!
715 ------------ Testing CALL ------------
716 ... external script ...
721 @todo_wine@foo ""@space@
722 @todo_wine@"" bar@space@
725 ... internal routines ...
733 ... with builtins ...
735 @todo_wine@foo created
736 @todo_wine@Should expand foobaz
742 ------------ Testing SHIFT ------------
743 'p1' 'p2' 'p3' 'p4' 'p5'
744 'p2' 'p3' 'p4' 'p5' ''
749 ------------ Testing cmd invocation ------------
750 ... a batch file can delete itself ...
751 file correctly deleted
752 ... a batch file can alter itself ...
754 ------------ Testing setlocal/endlocal ------------
755 ...enable/disable extensions
756 @todo_wine@ErrLev:@space@
759 @todo_wine@ErrLev:@space@@or_broken@ErrLev: 0
761 ...setlocal with corresponding endlocal
766 ...setlocal with no corresponding endlocal
770 -----------Testing Errorlevel-----------
773 errorlevel just right, good
774 abc0def@or_broken@abc1def
775 errorlevel zero, good@or_broken@errorlevel nonzero, bad
778 -----------Testing GOTO-----------
779 goto with no leading space worked
780 goto with a leading space worked
781 goto with a leading tab worked
782 goto with a following space worked
783 ---------- Testing combined CALLs/GOTOs -----------