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 read
-only files ...
605 read
-only file renamed
606 ...
rename directories ...
608 read
-only
dir renamed
609 ...
rename in other directory ...
610 @todo_wine@
rename impossible in other directory
611 @todo_wine@original file still present
612 ------------ Testing
move ------------
615 @todo_wine@file
move with overwrite succeeded@or_broken@file overwrite impossible
!
616 @todo_wine@bar@or_broken@baz
617 read
-only files are moveable
618 file moved in subdirectory
619 @todo_wine@moving a file to itself is a no
-op@or_broken@moving a file to itself should be a no
-op
!
620 @todo_wine@ErrorLevel
: 0@or_broken@ErrorLevel
: 1
621 ... directory
move ...
622 simple directory
move succeeded
623 moving a directory to itself gives error
; errlevel
1
624 ......
dir in
dir move ......
628 ------------ Testing
mkdir ------------
629 ... md and
mkdir are synonymous ...
632 ... creating an already existing directory
/file must fail ...
635 ... multilevel path creation ...
644 ... trailing backslashes ...
648 ... invalid chars ...
649 mkdir ? gives errorlevel
1
650 mkdir ?
\foo gives errorlevel
1
651 mkdir foo
\? gives errorlevel
1
653 mkdir foo
\bar
\? gives errorlevel
1
655 ... multiple directories at once ...
660 mkdir foo\
* errorlevel
1
662 ----------- Testing
rmdir -----------
671 non
-empty
dir not removed
673 non
-empty
dir not removed
674 recursive rmdir succeeded
675 recursive rmdir succeeded
680 ----------- Testing pushd
/popd
-----------
682 ...popd is no
-op when
dir stack is empty
684 ...pushing non
-existing
dir
695 ------------ Testing attrib
--------------
696 @todo_wine@A @pwd@
\foobar
\foo@or_broken@A @pwd@
\foobar
\foo@or_broken@A I @pwd@
\foobar
\foo
697 ... read
-only attribute
698 @todo_wine@A R @pwd@
\foobar
\foo@or_broken@A R @pwd@
\foobar
\foo@or_broken@A R I @pwd@
\foobar
\foo
700 foo original contents
701 Read
-only file not deleted
702 Read
-only file forcibly deleted
703 ...
recursive behaviour
704 @todo_wine@A @pwd@
\foobar
\baz\level2@or_broken@A @pwd@
\foobar
\baz\level2@or_broken@A I @pwd@
\foobar
\baz\level2
705 @todo_wine@A R @pwd@
\foobar\level1@or_broken@A R @pwd@
\foobar\level1@or_broken@A R I @pwd@
\foobar\level1
706 @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
707 @todo_wine@A @pwd@
\foobar
\bar@or_broken@A @pwd@
\foobar
\bar@or_broken@A I @pwd@
\foobar
\bar
708 ... folders processing
709 @todo_wine@ @pwd@
\foobar@or_broken@ @pwd@
\foobar@or_broken@ I @pwd@
\foobar
710 @todo_wine@ R @pwd@
\foobar
\baz@or_broken@ R @pwd@
\foobar
\baz@or_broken@ @pwd@
\foobar
\baz@or_broken@ R I @pwd@
\foobar
\baz
711 @todo_wine@A @pwd@
\foobar
\baz
\toto@or_broken@A @pwd@
\foobar
\baz
\toto@or_broken@A I @pwd@
\foobar
\baz
\toto
714 file created in read
-only
dir
715 ------------ Testing assoc
--------------
716 ...setting association
722 ...resetting association
726 ------------ Testing ftype
--------------
727 ...setting association
734 ...resetting association
735 @todo_wine@original value@or_broken@buggyXP@or_broken@
!FOO
!
736 ------------ Testing
CALL ------------
737 ... external script ...
742 @todo_wine@foo
""@space@
743 @todo_wine@
"" bar@space@
746 ... internal routines ...
754 ... with builtins ...
756 @todo_wine@foo created
757 @todo_wine@Should expand foobaz
763 ------------ Testing SHIFT
------------
764 'p1' 'p2' 'p3' 'p4' 'p5'
765 'p2' 'p3' 'p4' 'p5' ''
770 ------------ Testing cmd invocation
------------
771 ... a batch file can
delete itself ...
772 file correctly deleted
773 ... a batch file can alter itself ...
775 ------------ Testing setlocal
/endlocal
------------
776 ...enable
/disable extensions
777 @todo_wine@ErrLev
:@space@
780 @todo_wine@ErrLev
:@space@@or_broken@ErrLev
: 0
782 ...setlocal with corresponding endlocal
787 ...setlocal with no corresponding endlocal
791 -----------Testing Errorlevel
-----------
794 errorlevel just right
, good
795 errorlevel with leading zero just right
, good
796 errorlevel with negative number OK
797 abc0def@or_broken@abc1def
798 errorlevel zero
, good@or_broken@errorlevel nonzero
, bad
801 -----------Testing
GOTO-----------
802 goto with no leading space worked
803 goto with a leading space worked
804 goto with a leading tab worked
805 goto with a following space worked
806 ---------- Testing combined CALLs
/GOTOs
-----------