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
move ------------
610 @todo_wine@file
move with overwrite succeeded@or_broken@file overwrite impossible
!
611 @todo_wine@bar@or_broken@baz
612 read
-only files are moveable
613 file moved in subdirectory
614 @todo_wine@moving a file to itself is a no
-op@or_broken@moving a file to itself should be a no
-op
!
615 @todo_wine@ErrorLevel
: 0@or_broken@ErrorLevel
: 1
616 ... directory
move ...
617 simple directory
move succeeded
618 moving a directory to itself gives error
; errlevel
1
619 ......
dir in
dir move ......
623 ------------ Testing
mkdir ------------
624 ... md and
mkdir are synonymous ...
627 ... creating an already existing directory
/file must fail ...
630 ... multilevel path creation ...
639 ... trailing backslashes ...
643 ... invalid chars ...
644 mkdir ? gives errorlevel
1
645 mkdir ?
\foo gives errorlevel
1
646 mkdir foo
\? gives errorlevel
1
648 mkdir foo
\bar
\? gives errorlevel
1
650 ... multiple directories at once ...
655 mkdir foo\
* errorlevel
1
657 ----------- Testing
rmdir -----------
666 non
-empty
dir not removed
668 non
-empty
dir not removed
669 recursive rmdir succeeded
670 recursive rmdir succeeded
675 ----------- Testing pushd
/popd
-----------
677 ...popd is no
-op when
dir stack is empty
679 ...pushing non
-existing
dir
690 ------------ Testing attrib
--------------
691 @todo_wine@A @pwd@
\foobar
\foo@or_broken@A @pwd@
\foobar
\foo@or_broken@A I @pwd@
\foobar
\foo
692 ... read
-only attribute
693 @todo_wine@A R @pwd@
\foobar
\foo@or_broken@A R @pwd@
\foobar
\foo@or_broken@A R I @pwd@
\foobar
\foo
695 foo original contents
696 Read
-only file not deleted
697 Read
-only file forcibly deleted
698 ...
recursive behaviour
699 @todo_wine@A @pwd@
\foobar
\baz\level2@or_broken@A @pwd@
\foobar
\baz\level2@or_broken@A I @pwd@
\foobar
\baz\level2
700 @todo_wine@A R @pwd@
\foobar\level1@or_broken@A R @pwd@
\foobar\level1@or_broken@A R I @pwd@
\foobar\level1
701 @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
702 @todo_wine@A @pwd@
\foobar
\bar@or_broken@A @pwd@
\foobar
\bar@or_broken@A I @pwd@
\foobar
\bar
703 ... folders processing
704 @todo_wine@ @pwd@
\foobar@or_broken@ @pwd@
\foobar@or_broken@ I @pwd@
\foobar
705 @todo_wine@ R @pwd@
\foobar
\baz@or_broken@ R @pwd@
\foobar
\baz@or_broken@ @pwd@
\foobar
\baz@or_broken@ R I @pwd@
\foobar
\baz
706 @todo_wine@A @pwd@
\foobar
\baz
\toto@or_broken@A @pwd@
\foobar
\baz
\toto@or_broken@A I @pwd@
\foobar
\baz
\toto
709 file created in read
-only
dir
710 ------------ Testing assoc
--------------
711 ...setting association
717 ...resetting association
721 ------------ Testing ftype
--------------
722 ...setting association
729 ...resetting association
730 @todo_wine@original value@or_broken@buggyXP@or_broken@
!FOO
!
731 ------------ Testing
CALL ------------
732 ... external script ...
737 @todo_wine@foo
""@space@
738 @todo_wine@
"" bar@space@
741 ... internal routines ...
749 ... with builtins ...
751 @todo_wine@foo created
752 @todo_wine@Should expand foobaz
758 ------------ Testing SHIFT
------------
759 'p1' 'p2' 'p3' 'p4' 'p5'
760 'p2' 'p3' 'p4' 'p5' ''
765 ------------ Testing cmd invocation
------------
766 ... a batch file can
delete itself ...
767 file correctly deleted
768 ... a batch file can alter itself ...
770 ------------ Testing setlocal
/endlocal
------------
771 ...enable
/disable extensions
772 @todo_wine@ErrLev
:@space@
775 @todo_wine@ErrLev
:@space@@or_broken@ErrLev
: 0
777 ...setlocal with corresponding endlocal
782 ...setlocal with no corresponding endlocal
786 -----------Testing Errorlevel
-----------
789 errorlevel just right
, good
790 abc0def@or_broken@abc1def
791 errorlevel zero
, good@or_broken@errorlevel nonzero
, bad
794 -----------Testing
GOTO-----------
795 goto with no leading space worked
796 goto with a leading space worked
797 goto with a leading tab worked
798 goto with a following space worked
799 ---------- Testing combined CALLs
/GOTOs
-----------