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 Testing case sensitivity with and without
/i option
425 if seems to default to case sensitivity
428 Testing string comparisons
433 Testing tabs handling
441 ------------ Testing
for ------------
500 Plain directory enumeration
501 Plain directory enumeration from provided root
503 File enumeration from provided root
505 Mixed enumeration from provided root
506 With duplicates enumeration
507 Strip missing wildcards
, keep unwildcarded names
542 ------ individual operations
558 0@or_broken@
1073741824
559 0@or_broken@
-1073741824
580 ------ precedence and grouping
583 @todo_wine@
18@or_broken@
10
584 @todo_wine@
2@or_broken@
0
585 @todo_wine@
2@or_broken@
0
588 @todo_wine@
3@or_broken@
4
589 ------ octal and hexadecimal
590 @todo_wine@
3@or_broken@
4
596 @todo_wine@
3@or_broken@foo not defined
597 @todo_wine@
3@or_broken@
0
598 @todo_wine@
3@or_broken@
0
599 @todo_wine@
3@or_broken@
0
600 @todo_wine@
9@or_broken@
0
602 @todo_wine@
4@or_broken@
0
603 @todo_wine@
-7@or_broken@
0
604 @todo_wine@
-1@or_broken@
0
605 @todo_wine@
5@or_broken@
0
606 @todo_wine@
4@or_broken@
0
607 @todo_wine@
1@or_broken@
0
609 @todo_wine@
5@or_broken@
0
612 ------ string
argument
618 ------ fileset argument
619 --------- basic
blank handling
626 --------- multi
-line with empty lines
630 --------- multiple files
659 ------------ Testing del
/a
------------
660 not
-r.test not found after
delete, good
661 r.test found before
delete, good
662 r.test not found after
delete, good
663 ------------ Testing del
/q
------------
664 del
/q
* succeeded
on file1
665 del
/q
* succeeded
on file2.dat
666 ------------ Testing del
/s
------------
667 ------------ Testing
rename ------------
668 --- ren and
rename are synonymous
674 --- rename read
-only files
675 read
-only file renamed
676 --- rename directories
678 read
-only
dir renamed
679 --- rename in other directory
680 rename impossible in other directory
681 original file still present
682 ------------ Testing
move ------------
685 @todo_wine@file
move with overwrite succeeded@or_broken@file overwrite impossible
!
686 @todo_wine@bar@or_broken@baz
687 read
-only files are moveable
688 file moved in subdirectory
689 @todo_wine@moving a file to itself is a no
-op@or_broken@moving a file to itself should be a no
-op
!
690 @todo_wine@ErrorLevel
: 0@or_broken@ErrorLevel
: 1
692 simple directory
move succeeded
693 moving a directory to itself gives error
; errlevel
1
694 ------ dir in
dir move
698 ------------ Testing
mkdir ------------
699 --- md and
mkdir are synonymous
702 --- creating an already existing directory
/file must fail
705 --- multilevel path creation
714 --- trailing backslashes
719 mkdir ? gives errorlevel
1
720 mkdir ?
\foo gives errorlevel
1
721 mkdir foo
\? gives errorlevel
1
723 mkdir foo
\bar
\? gives errorlevel
1
725 --- multiple directories at once
732 mkdir foo\
* errorlevel
1
734 ------------ Testing
rmdir ------------
743 non
-empty
dir not removed
745 non
-empty
dir not removed
746 recursive rmdir succeeded
747 recursive rmdir succeeded
752 ------------ Testing pushd
/popd
------------
754 --- popd is no
-op when
dir stack is empty
756 --- pushing non
-existing
dir
767 ------------ Testing attrib
------------
768 A @pwd@
\foobar
\foo@or_broken@A @pwd@
\foobar
\foo@or_broken@A I @pwd@
\foobar
\foo
769 --- read
-only attribute
770 A R @pwd@
\foobar
\foo@or_broken@A R @pwd@
\foobar
\foo@or_broken@A R I @pwd@
\foobar
\foo
772 foo original contents
773 Read
-only file not deleted
774 Read
-only file forcibly deleted
775 --- recursive behaviour
776 @todo_wine@A @pwd@
\foobar
\baz\level2@or_broken@A @pwd@
\foobar
\baz\level2@or_broken@A I @pwd@
\foobar
\baz\level2
777 @todo_wine@A R @pwd@
\foobar\level1@or_broken@A R @pwd@
\foobar\level1@or_broken@A R I @pwd@
\foobar\level1
778 @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
779 A @pwd@
\foobar
\bar@or_broken@A @pwd@
\foobar
\bar@or_broken@A I @pwd@
\foobar
\bar
780 --- folders processing
781 @pwd@
\foobar@or_broken@ @pwd@
\foobar@or_broken@ I @pwd@
\foobar
782 @todo_wine@ R @pwd@
\foobar
\baz@or_broken@ R @pwd@
\foobar
\baz@or_broken@ @pwd@
\foobar
\baz@or_broken@ R I @pwd@
\foobar
\baz
783 @todo_wine@A @pwd@
\foobar
\baz
\toto@or_broken@A @pwd@
\foobar
\baz
\toto@or_broken@A I @pwd@
\foobar
\baz
\toto
786 file created in read
-only
dir
787 ------------ Testing assoc
------------
788 --- setting association
794 --- resetting association
798 ------------ Testing ftype
------------
799 --- setting association
806 --- resetting association
807 @todo_wine@original value@or_broken@buggyXP@or_broken@
!FOO
!
808 ------------ Testing
CALL ------------
818 --- internal routines
840 ------------ Testing SHIFT
------------
841 'p1' 'p2' 'p3' 'p4' 'p5'
842 'p2' 'p3' 'p4' 'p5' ''
847 ------------ Testing cmd invocation
------------
848 --- a batch file can
delete itself
849 file correctly deleted
850 --- a batch file can alter itself
852 ---------- Testing copy
853 Passed
: Found expected dummy.file
854 Passed
: Found expected dir1
\file
1
855 Passed
: Found expected dir1
\file
1
856 Passed
: Found expected dir1
\file
99
857 Passed
: Found expected file1
858 Passed
: Did not find dir2
859 Passed
: Did not find dir2
\file
1
860 Passed
: Found expected dir1
\file
1
861 Passed
: Found expected dir1
\file
2
862 Passed
: Found expected dir1
\file
3
863 Passed
: Found expected dir1
\file
1
864 Passed
: Found expected dir1
\file
2
865 Passed
: Found expected dir1
\file
3
866 Passed
: Found expected file1
867 Passed
: Found expected file2
868 Passed
: Found expected file3
869 Passed
: Did not find dir2
870 Passed
: Did not find dir2
\file
1
871 Passed
: Did not find dir2
\file
2
872 Passed
: Did not find dir2
\file
3
873 Passed
: Found expected testfile
874 Passed
: Found expected testfile
875 Passed
: Found expected testfile
876 Passed
: Found expected testfile
877 Passed
: Found expected testfile
878 Passed
: Found expected dir1
\fred
879 Passed
: Found expected dir1
\fred
880 Passed
: Found expected fred
881 Passed
: Found expected fred
882 Passed
: file size check
on file1
[5]@or_broken@Skipping file size check
on NT4
883 Passed
: file size check
on file2
[8]@or_broken@Skipping file size check
on NT4
884 Passed
: file size check
on file3
[11]@or_broken@Skipping file size check
on NT4
885 Passed
: file size check
on file1_default
[5]@or_broken@Skipping file size check
on NT4
886 Passed
: file size check
on file1_default2
[5]@or_broken@Skipping file size check
on NT4
887 Passed
: file size check
on file1_plus_eof
[6]@or_broken@Skipping file size check
on NT4
888 Passed
: file size check
on file2_plus_eof
[9]@or_broken@Skipping file size check
on NT4
889 Passed
: file size check
on file3_plus_eof
[12]@or_broken@Skipping file size check
on NT4
890 Passed
: file size check
on file12_plus_eof
[14]@or_broken@Skipping file size check
on NT4
891 Passed
: file size check
on file12_no_eof
[13]@or_broken@Skipping file size check
on NT4
892 Passed
: file size check
on file12_eof2
[14]@or_broken@Skipping file size check
on NT4
893 Passed
: file size check
on file1_binary_srccopy
[6]@or_broken@Skipping file size check
on NT4
894 Passed
: file size check
on file1_ascii_srccopy
[5]@or_broken@Skipping file size check
on NT4
895 Passed
: file size check
on file123_default_copy
[25]@or_broken@Skipping file size check
on NT4
896 Passed
: file size check
on file123_ascii_copy
[25]@or_broken@Skipping file size check
on NT4
897 Passed
: file size check
on file123_binary_copy
[27]@or_broken@Skipping file size check
on NT4
898 Passed
: file size check
on file123_mixed_copy1
[26]@or_broken@Skipping file size check
on NT4
899 Passed
: file size check
on file123_mixed_copy2
[27]@or_broken@Skipping file size check
on NT4
900 Passed
: file size check
on file123_mixed_copy3
[26]@or_broken@Skipping file size check
on NT4
901 Passed
: file size check
on file123_mixed_copy4
[25]@or_broken@Skipping file size check
on NT4
902 Passed
: file size check
on file123_mixed_copy5
[28]@or_broken@Skipping file size check
on NT4
903 Passed
: file size check
on file123_mixed_copy6
[19]@or_broken@Skipping file size check
on NT4
904 Passed
: file size check
on file123_mixed_copy7
[6]@or_broken@Skipping file size check
on NT4
905 Passed
: file size check
on file123_mixed_copy8
[7]@or_broken@Skipping file size check
on NT4
906 Passed
: errorlevel invalid check
1
907 Passed
: Did not find dir1
\file
1
908 Passed
: errorlevel invalid check
2
909 Passed
: errorlevel invalid check
3
910 ------------ Testing setlocal
/endlocal
------------
911 --- enable
/disable extensions
912 @todo_wine@ErrLev
:@space@
915 @todo_wine@ErrLev
:@space@@or_broken@ErrLev
: 0
917 --- setlocal with corresponding endlocal
925 --- setlocal with no corresponding endlocal
931 --- setlocal within same batch
program
944 --- Mismatched
set and end locals
945 --- Extra setlocal in called batch
954 --- Extra endlocal in called batch
965 --- endlocal in called function rather than batch pgm is ineffective
974 ------------ Testing Errorlevel
------------
977 errorlevel just right
, good
978 errorlevel with leading zero just right
, good
979 errorlevel with negative number OK
980 abc0def@or_broken@abc1def
981 errorlevel zero
, good@or_broken@errorlevel nonzero
, bad
984 ------------ Testing
GOTO ------------
985 goto with no leading space worked
986 goto with a leading space worked
987 goto with a leading tab worked
988 goto with a following space worked
989 ------------ Testing PATH
------------
993 ------------ Testing combined CALLs
/GOTOs
------------