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@
''
308 '--a------'@or_broken@
'%~ai'
338 @todo_wine@
'@drive@@shortpath@R S'@or_broken@
''
339 @todo_wine@
'@drive@@shortpath@T'@or_broken@
''
340 @todo_wine@
'@drive@@shortpath@ABCDEFGHIJK.LMNOP'@or_broken@
''
349 ------------ Testing
variable delayed expansion
------------
350 --- default
mode (load-time expansion
)
355 --- runtime
(delayed
) expansion
mode
357 @todo_wine@foo@or_broken@
!FOO
!
359 @todo_wine@bar@or_broken@foo
364 --- using
/V cmd flag
366 @todo_wine@foo@or_broken@
!FOO
!
369 ------------ Testing conditional execution
------------
370 --- unconditional ampersand
375 --- on success conditional and
376 @todo_wine@foo3 not created
379 --- on failure conditional or
382 @todo_wine@
------------ Testing cd
------------
384 Current
dir: @pwd@
\foobar@or_broken@Current
dir:@space@
400 ------------ Testing type
------------
402 @pwd@
>type foobaz@space@
405 @pwd@
>echo
---@space@
413 ------------ Testing NUL
------------
418 @todo_wine@foo created
419 ------------ Testing
if/else ------------
420 --- if/else should work with blocks
423 if seems not to detect
/c as parameter
424 --- case sensitivity with and without
/i option
425 if seems to default to case sensitivity
428 --- string comparisons
441 --- comparison operators
443 LSS string can be used as operand
for LSS comparison
444 @todo_wine@floats are handled as strings
445 @todo_wine@numbers in quotes are handled as strings
446 @todo_wine@negative numbers as well@or_broken@NT4
447 @todo_wine@
if /i seems to work
for LSS
458 @todo_wine@b LSS B@or_broken@NT4
459 @todo_wine@a LSS B@or_broken@NT4
460 @todo_wine@a LSS B insensitive
462 @todo_wine@A LSS b insensitive
478 @todo_wine@b LEQ B@or_broken@NT4
479 @todo_wine@b LEQ B insensitive
480 @todo_wine@a LEQ B@or_broken@NT4
481 @todo_wine@a LEQ B insensitive
483 @todo_wine@A LEQ b insensitive
485 negative numbers handled
486 negative numbers handled
488 also in negative form
490 also in negative form
508 ------------ Testing
for ------------
567 Plain directory enumeration
568 Plain directory enumeration from provided root
570 File enumeration from provided root
572 Mixed enumeration from provided root
573 With duplicates enumeration
574 Strip missing wildcards
, keep unwildcarded names
609 ------ individual operations
625 0@or_broken@
1073741824
626 0@or_broken@
-1073741824
647 ------ precedence and grouping
650 @todo_wine@
18@or_broken@
10
651 @todo_wine@
2@or_broken@
0
652 @todo_wine@
2@or_broken@
0
655 @todo_wine@
3@or_broken@
4
656 ------ octal and hexadecimal
657 @todo_wine@
3@or_broken@
4
663 @todo_wine@
3@or_broken@foo not defined
664 @todo_wine@
3@or_broken@
0
665 @todo_wine@
3@or_broken@
0
666 @todo_wine@
3@or_broken@
0
667 @todo_wine@
9@or_broken@
0
669 @todo_wine@
4@or_broken@
0
670 @todo_wine@
-7@or_broken@
0
671 @todo_wine@
-1@or_broken@
0
672 @todo_wine@
5@or_broken@
0
673 @todo_wine@
4@or_broken@
0
674 @todo_wine@
1@or_broken@
0
676 @todo_wine@
5@or_broken@
0
679 ------ string
argument
685 ------ fileset argument
686 --------- basic
blank handling
693 --------- multi
-line with empty lines
697 --------- multiple files
726 ------------ Testing del
/a
------------
727 not
-r.test not found after
delete, good
728 r.test found before
delete, good
729 r.test not found after
delete, good
730 ------------ Testing del
/q
------------
731 del
/q
* succeeded
on file1
732 del
/q
* succeeded
on file2.dat
733 ------------ Testing del
/s
------------
734 ------------ Testing
rename ------------
735 --- ren and
rename are synonymous
741 --- rename read
-only files
742 read
-only file renamed
743 --- rename directories
745 read
-only
dir renamed
746 --- rename in other directory
747 rename impossible in other directory
748 original file still present
749 ------------ Testing
move ------------
752 @todo_wine@file
move with overwrite succeeded@or_broken@file overwrite impossible
!
753 @todo_wine@bar@or_broken@baz
754 read
-only files are moveable
755 file moved in subdirectory
756 @todo_wine@moving a file to itself is a no
-op@or_broken@moving a file to itself should be a no
-op
!
757 @todo_wine@ErrorLevel
: 0@or_broken@ErrorLevel
: 1
759 simple directory
move succeeded
760 moving a directory to itself gives error
; errlevel
1
761 ------ dir in
dir move
765 ------------ Testing
mkdir ------------
766 --- md and
mkdir are synonymous
769 --- creating an already existing directory
/file must fail
772 --- multilevel path creation
781 --- trailing backslashes
786 mkdir ? gives errorlevel
1
787 mkdir ?
\foo gives errorlevel
1
788 mkdir foo
\? gives errorlevel
1
790 mkdir foo
\bar
\? gives errorlevel
1
792 --- multiple directories at once
799 mkdir foo\
* errorlevel
1
801 ------------ Testing
rmdir ------------
810 non
-empty
dir not removed
812 non
-empty
dir not removed
813 recursive rmdir succeeded
814 recursive rmdir succeeded
819 ------------ Testing pushd
/popd
------------
821 --- popd is no
-op when
dir stack is empty
823 --- pushing non
-existing
dir
834 ------------ Testing attrib
------------
835 A @pwd@
\foobar
\foo@or_broken@A @pwd@
\foobar
\foo@or_broken@A I @pwd@
\foobar
\foo
836 --- read
-only attribute
837 A R @pwd@
\foobar
\foo@or_broken@A R @pwd@
\foobar
\foo@or_broken@A R I @pwd@
\foobar
\foo
839 foo original contents
840 Read
-only file not deleted
841 Read
-only file forcibly deleted
842 --- recursive behaviour
843 @todo_wine@A @pwd@
\foobar
\baz\level2@or_broken@A @pwd@
\foobar
\baz\level2@or_broken@A I @pwd@
\foobar
\baz\level2
844 @todo_wine@A R @pwd@
\foobar\level1@or_broken@A R @pwd@
\foobar\level1@or_broken@A R I @pwd@
\foobar\level1
845 @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
846 A @pwd@
\foobar
\bar@or_broken@A @pwd@
\foobar
\bar@or_broken@A I @pwd@
\foobar
\bar
847 --- folders processing
848 @pwd@
\foobar@or_broken@ @pwd@
\foobar@or_broken@ I @pwd@
\foobar
849 @todo_wine@ R @pwd@
\foobar
\baz@or_broken@ R @pwd@
\foobar
\baz@or_broken@ @pwd@
\foobar
\baz@or_broken@ R I @pwd@
\foobar
\baz
850 @todo_wine@A @pwd@
\foobar
\baz
\toto@or_broken@A @pwd@
\foobar
\baz
\toto@or_broken@A I @pwd@
\foobar
\baz
\toto
853 file created in read
-only
dir
854 ------------ Testing assoc
------------
855 --- setting association
861 --- resetting association
865 ------------ Testing ftype
------------
866 --- setting association
873 --- resetting association
874 @todo_wine@original value@or_broken@buggyXP@or_broken@
!FOO
!
875 ------------ Testing
CALL ------------
885 --- internal routines
907 ------------ Testing SHIFT
------------
908 'p1' 'p2' 'p3' 'p4' 'p5'
909 'p2' 'p3' 'p4' 'p5' ''
914 ------------ Testing cmd invocation
------------
915 --- a batch file can
delete itself
916 file correctly deleted
917 --- a batch file can alter itself
919 ---------- Testing copy
920 Passed
: Found expected dummy.file
921 Passed
: Found expected dir1
\file
1
922 Passed
: Found expected dir1
\file
1
923 Passed
: Found expected dir1
\file
99
924 Passed
: Found expected file1
925 Passed
: Did not find dir2
926 Passed
: Did not find dir2
\file
1
927 Passed
: Found expected dir1
\file
1
928 Passed
: Found expected dir1
\file
2
929 Passed
: Found expected dir1
\file
3
930 Passed
: Found expected dir1
\file
1
931 Passed
: Found expected dir1
\file
2
932 Passed
: Found expected dir1
\file
3
933 Passed
: Found expected file1
934 Passed
: Found expected file2
935 Passed
: Found expected file3
936 Passed
: Did not find dir2
937 Passed
: Did not find dir2
\file
1
938 Passed
: Did not find dir2
\file
2
939 Passed
: Did not find dir2
\file
3
940 Passed
: Found expected testfile
941 Passed
: Found expected testfile
942 Passed
: Found expected testfile
943 Passed
: Found expected testfile
944 Passed
: Found expected testfile
945 Passed
: Found expected dir1
\fred
946 Passed
: Found expected dir1
\fred
947 Passed
: Found expected fred
948 Passed
: Found expected fred
949 Passed
: file size check
on file1
[5]@or_broken@Skipping file size check
on NT4
950 Passed
: file size check
on file2
[8]@or_broken@Skipping file size check
on NT4
951 Passed
: file size check
on file3
[11]@or_broken@Skipping file size check
on NT4
952 Passed
: file size check
on file1_default
[5]@or_broken@Skipping file size check
on NT4
953 Passed
: file size check
on file1_default2
[5]@or_broken@Skipping file size check
on NT4
954 Passed
: file size check
on file1_plus_eof
[6]@or_broken@Skipping file size check
on NT4
955 Passed
: file size check
on file2_plus_eof
[9]@or_broken@Skipping file size check
on NT4
956 Passed
: file size check
on file3_plus_eof
[12]@or_broken@Skipping file size check
on NT4
957 Passed
: file size check
on file12_plus_eof
[14]@or_broken@Skipping file size check
on NT4
958 Passed
: file size check
on file12_no_eof
[13]@or_broken@Skipping file size check
on NT4
959 Passed
: file size check
on file12_eof2
[14]@or_broken@Skipping file size check
on NT4
960 Passed
: file size check
on file1_binary_srccopy
[6]@or_broken@Skipping file size check
on NT4
961 Passed
: file size check
on file1_ascii_srccopy
[5]@or_broken@Skipping file size check
on NT4
962 Passed
: file size check
on file123_default_copy
[25]@or_broken@Skipping file size check
on NT4
963 Passed
: file size check
on file123_ascii_copy
[25]@or_broken@Skipping file size check
on NT4
964 Passed
: file size check
on file123_binary_copy
[27]@or_broken@Skipping file size check
on NT4
965 Passed
: file size check
on file123_mixed_copy1
[26]@or_broken@Skipping file size check
on NT4
966 Passed
: file size check
on file123_mixed_copy2
[27]@or_broken@Skipping file size check
on NT4
967 Passed
: file size check
on file123_mixed_copy3
[26]@or_broken@Skipping file size check
on NT4
968 Passed
: file size check
on file123_mixed_copy4
[25]@or_broken@Skipping file size check
on NT4
969 Passed
: file size check
on file123_mixed_copy5
[28]@or_broken@Skipping file size check
on NT4
970 Passed
: file size check
on file123_mixed_copy6
[19]@or_broken@Skipping file size check
on NT4
971 Passed
: file size check
on file123_mixed_copy7
[6]@or_broken@Skipping file size check
on NT4
972 Passed
: file size check
on file123_mixed_copy8
[7]@or_broken@Skipping file size check
on NT4
973 Passed
: errorlevel invalid check
1
974 Passed
: Did not find dir1
\file
1
975 Passed
: errorlevel invalid check
2
976 Passed
: errorlevel invalid check
3
977 ------------ Testing setlocal
/endlocal
------------
978 --- enable
/disable extensions
979 @todo_wine@ErrLev
:@space@
982 @todo_wine@ErrLev
:@space@@or_broken@ErrLev
: 0
984 --- setlocal with corresponding endlocal
992 --- setlocal with no corresponding endlocal
998 --- setlocal within same batch
program
1011 --- Mismatched
set and end locals
1012 --- Extra setlocal in called batch
1015 @pwd@
\foobar
\foodir
3
1018 @pwd@
\foobar
\foodir
2
1021 --- Extra endlocal in called batch
1024 @pwd@
\foobar
\foodir
2
1026 @pwd@
\foobar
\foodir
2
1029 @pwd@
\foobar
\foodir
2
1032 --- endlocal in called function rather than batch pgm is ineffective
1041 ------------ Testing Errorlevel
------------
1044 errorlevel just right
, good
1045 errorlevel with leading zero just right
, good
1046 errorlevel with negative number OK
1047 abc0def@or_broken@abc1def
1048 errorlevel zero
, good@or_broken@errorlevel nonzero
, bad
1051 ------------ Testing
GOTO ------------
1052 goto with no leading space worked
1053 goto with a leading space worked
1054 goto with a leading tab worked
1055 goto with a following space worked
1056 ------------ Testing PATH
------------
1060 ------------ Testing combined CALLs
/GOTOs
------------