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' ------------
231 WINE_FOOBAR not defined
241 WINE_FOOBAR not defined
248 set "WINE_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 ------------
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@!WINE_FOO!
359 @todo_wine@bar@or_broken@foo
364 --- using /V cmd flag
366 @todo_wine@foo@or_broken@!WINE_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 ------------
419 Passed: file size check on a.a [7]@or_broken@Skipping file size check on NT4
420 Passed: file size check on b.b [8]@or_broken@Skipping file size check on NT4
421 Passed: file size check on a.a [7]@or_broken@Skipping file size check on NT4
422 Passed: file size check on b.b [8]@or_broken@Skipping file size check on NT4
423 Passed: file size check on a.a [7]@or_broken@Skipping file size check on NT4
424 Passed: file size check on subdir\a.a [8]@or_broken@Skipping file size check on NT4
425 ------------ Testing if/else ------------
426 --- if/else should work with blocks
429 if seems not to detect /c as parameter
430 --- case sensitivity with and without /i option
431 if seems to default to case sensitivity
434 --- string comparisons
447 --- comparison operators
449 LSS string can be used as operand for LSS comparison
450 floats are handled as strings
451 numbers in quotes are handled as strings
452 negative numbers as well@or_broken@NT4
453 if /i seems to work for LSS
464 b LSS B@or_broken@NT4
465 a LSS B@or_broken@NT4
484 b LEQ B@or_broken@NT4
486 a LEQ B@or_broken@NT4
542 negative numbers handled
543 negative numbers handled
545 also in negative form
547 also in negative form
571 string/hexa compare ok
572 string/hexa compare ok
601 ------ for numbers and stringified numbers
602 strings and integers not equal
603 strings and integers not equal
606 '1' GEQ 1@or_broken@NT4
611 non NT4@or_broken@1 GEQ '1'
618 ------------ Testing for ------------
677 Plain directory enumeration
678 Plain directory enumeration from provided root
680 File enumeration from provided root
682 Mixed enumeration from provided root
683 With duplicates enumeration
684 Strip missing wildcards, keep unwildcarded names
719 ------ individual operations
735 0@or_broken@1073741824
736 0@or_broken@-1073741824
757 ------ precedence and grouping
760 @todo_wine@18@or_broken@10
761 @todo_wine@2@or_broken@0
762 @todo_wine@2@or_broken@0
765 @todo_wine@3@or_broken@4
766 ------ octal and hexadecimal
767 @todo_wine@3@or_broken@4
773 @todo_wine@3@or_broken@WINE_foo not defined
774 @todo_wine@3@or_broken@0
775 @todo_wine@3@or_broken@0
776 @todo_wine@3@or_broken@0
777 @todo_wine@9@or_broken@0
779 @todo_wine@4@or_broken@0
780 @todo_wine@-7@or_broken@0
781 @todo_wine@-1@or_broken@0
782 @todo_wine@5@or_broken@0
783 @todo_wine@4@or_broken@0
784 @todo_wine@1@or_broken@0
786 @todo_wine@5@or_broken@0
789 ------ string argument
791 a@or_broken@no output
793 a@or_broken@no output
795 a@or_broken@no output
797 a@or_broken@no output
799 a@or_broken@no output
800 ------ fileset argument
801 --------- basic blank handling
808 --------- multi-line with empty lines
812 --------- multiple files
823 ------ command argument
824 Passed1@or_broken@Missing functionality - Broken1
825 Passed2@or_broken@Missing functionality - Broken2
826 Passed3@or_broken@Missing functionality - Broken3
828 and@or_broken@Broken NT4 functionality1
829 Line@or_broken@Broken NT4 functionality2
830 Line@or_broken@Broken NT4 functionality3
851 ------ tokens= option
852 h=%h i=a j=%j k=%k l=%l m=%m o=%o
853 h=%h i=b j=%j k=%k l=%l m=%m o=%o
854 h=%h i=a j=c k=e l=f m=g o=%o
855 h=%h i=a j=e k=f g l=%l m=%m o=%o
856 h=%h i=f j=i k=j k l m n o p q r s t u v w x y z l=%l m=%m o=%o
857 h=%h i=f j=i k=j k l m n;;== o p q r s t u v w x y z l=%l m=%m o=%o
858 h=%h i=a j=b k=c l=d e f g m=%m n=%n o=%o
859 h=%h i=a j=b k=c l=d e f g m=%m n=%n o=%o
860 h=%h i=a j=b k= l= m=%m n=%n o=%o
861 h=%h i=a j=e k=y l=z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z m=%m n=%n o=%o
862 h=%h i=a j=b k= l= m= n=%n o=%o
863 h=%h i=a j=b k= l= m= n= o=%o
864 u=a v=b w=c x=d y=e z=f A=%A a=%a
865 @todo_wine@U=a V=b W=c X=d Y=e Z=f A=%A a=m
866 h=%h i=a j=b k=c l=e m=%m o=%o@or_broken@h=%h i=a j=b k=c l=e m= o=%o
867 h=%h i=e j=%j k=%k l=%l m=%m o=%o
868 h=%h i=a j=b k=c l=d e f g m=%m n=%n o=%o@or_broken@h=%h i=a j=b k=c l=d e f g m= n=%n o=%o
869 h=%h i=a j=c k= l= m=%m n=%n o=%o@or_broken@h=%h i=a j=c k= l= m= n=%n o=%o
870 h=%h i=b j=c k= l= m=%m n=%n o=%o@or_broken@h=%h i=b j=c k= l= m= n=%n o=%o
871 h=%h i=b j=c k= l= m=%m n=%n o=%o@or_broken@h=%h i=b j=c k= l= m= n=%n o=%o
872 ------------ Testing del /a ------------
873 not-r.test not found after delete, good
874 r.test found before delete, good
875 r.test not found after delete, good
876 ------------ Testing del /q ------------
877 del /q * succeeded on file1
878 del /q * succeeded on file2.dat
879 ------------ Testing del /s ------------
880 ------------ Testing rename ------------
881 --- ren and rename are synonymous
887 --- rename read-only files
888 read-only file renamed
889 --- rename directories
891 read-only dir renamed
892 --- rename in other directory
893 rename impossible in other directory
894 original file still present
895 ------------ Testing move ------------
898 @todo_wine@file move with overwrite succeeded@or_broken@file overwrite impossible!
899 @todo_wine@bar@or_broken@baz
900 read-only files are moveable
901 file moved in subdirectory
902 @todo_wine@moving a file to itself is a no-op@or_broken@moving a file to itself should be a no-op!
903 @todo_wine@ErrorLevel: 0@or_broken@ErrorLevel: 1
905 simple directory move succeeded
906 moving a directory to itself gives error; errlevel 1
907 ------ dir in dir move
911 ------------ Testing mkdir ------------
912 --- md and mkdir are synonymous
915 --- creating an already existing directory/file must fail
918 --- multilevel path creation
927 --- trailing backslashes
932 mkdir ? gives errorlevel 1
933 mkdir ?\foo gives errorlevel 1
934 mkdir foo\? gives errorlevel 1
936 mkdir foo\bar\? gives errorlevel 1
938 --- multiple directories at once
945 mkdir foo\* errorlevel 1
947 ------------ Testing rmdir ------------
956 non-empty dir not removed
958 non-empty dir not removed
959 recursive rmdir succeeded
960 recursive rmdir succeeded
965 ------------ Testing pushd/popd ------------
967 --- popd is no-op when dir stack is empty
969 --- pushing non-existing dir
980 ------------ Testing attrib ------------
981 A @pwd@\foobar\foo@or_broken@A @pwd@\foobar\foo@or_broken@A I @pwd@\foobar\foo
982 --- read-only attribute
983 A R @pwd@\foobar\foo@or_broken@A R @pwd@\foobar\foo@or_broken@A R I @pwd@\foobar\foo
985 foo original contents
986 Read-only file not deleted
987 Read-only file forcibly deleted
988 --- recursive behaviour
989 A @pwd@\foobar\baz\level2@or_broken@A @pwd@\foobar\baz\level2@or_broken@A I @pwd@\foobar\baz\level2
990 A R @pwd@\foobar\level1@or_broken@A R @pwd@\foobar\level1@or_broken@A R I @pwd@\foobar\level1
991 A R @pwd@\foobar\baz\level2@or_broken@A R @pwd@\foobar\baz\level2@or_broken@A R I @pwd@\foobar\baz\level2
992 A @pwd@\foobar\bar@or_broken@A @pwd@\foobar\bar@or_broken@A I @pwd@\foobar\bar
993 --- folders processing
994 @pwd@\foobar@or_broken@ @pwd@\foobar@or_broken@ I @pwd@\foobar
995 @todo_wine@ R @pwd@\foobar\baz@or_broken@ R @pwd@\foobar\baz@or_broken@ @pwd@\foobar\baz@or_broken@ R I @pwd@\foobar\baz
996 A @pwd@\foobar\baz\toto@or_broken@A @pwd@\foobar\baz\toto@or_broken@A I @pwd@\foobar\baz\toto
999 file created in read-only dir
1000 ------------ Testing assoc ------------
1001 --- setting association
1007 --- resetting association
1011 ------------ Testing ftype ------------
1012 --- setting association
1019 --- resetting association
1020 @todo_wine@original value@or_broken@buggyXP@or_broken@!WINE_FOO!
1021 ------------ Testing CALL ------------
1031 --- internal routines
1042 Should expand foobaz
1053 ------------ Testing SHIFT ------------
1054 'p1' 'p2' 'p3' 'p4' 'p5'
1055 'p2' 'p3' 'p4' 'p5' ''
1056 'p3' 'p4' 'p5' '' ''
1060 ------------ Testing cmd invocation ------------
1061 --- a batch file can delete itself
1062 file correctly deleted
1063 --- a batch file can alter itself
1065 ---------- Testing copy
1066 Passed: Found expected dummy.file
1067 Passed: Found expected dir1\file1
1068 Passed: Found expected dir1\file1
1069 Passed: Found expected dir1\file99
1070 Passed: Found expected file1
1071 Passed: Did not find dir2
1072 Passed: Did not find dir2\file1
1073 Passed: Found expected dir1\file1
1074 Passed: Found expected dir1\file2
1075 Passed: Found expected dir1\file3
1076 Passed: Found expected dir1\file1
1077 Passed: Found expected dir1\file2
1078 Passed: Found expected dir1\file3
1079 Passed: Found expected file1
1080 Passed: Found expected file2
1081 Passed: Found expected file3
1082 Passed: Did not find dir2
1083 Passed: Did not find dir2\file1
1084 Passed: Did not find dir2\file2
1085 Passed: Did not find dir2\file3
1086 Passed: Found expected testfile
1087 Passed: Found expected testfile
1088 Passed: Found expected testfile
1089 Passed: Found expected testfile
1090 Passed: Found expected testfile
1091 Passed: Found expected dir1\fred
1092 Passed: Found expected dir1\fred
1093 Passed: Found expected fred
1094 Passed: Found expected fred
1095 Passed: file size check on file1 [5]@or_broken@Skipping file size check on NT4
1096 Passed: file size check on file2 [8]@or_broken@Skipping file size check on NT4
1097 Passed: file size check on file3 [11]@or_broken@Skipping file size check on NT4
1098 Passed: file size check on file1_default [5]@or_broken@Skipping file size check on NT4
1099 Passed: file size check on file1_default2 [5]@or_broken@Skipping file size check on NT4
1100 Passed: file size check on file1_plus_eof [6]@or_broken@Skipping file size check on NT4
1101 Passed: file size check on file2_plus_eof [9]@or_broken@Skipping file size check on NT4
1102 Passed: file size check on file3_plus_eof [12]@or_broken@Skipping file size check on NT4
1103 Passed: file size check on file12_plus_eof [14]@or_broken@Skipping file size check on NT4
1104 Passed: file size check on file12_no_eof [13]@or_broken@Skipping file size check on NT4
1105 Passed: file size check on file12_eof2 [14]@or_broken@Skipping file size check on NT4
1106 Passed: file size check on file1_binary_srccopy [6]@or_broken@Skipping file size check on NT4
1107 Passed: file size check on file1_ascii_srccopy [5]@or_broken@Skipping file size check on NT4
1108 Passed: file size check on file123_default_copy [25]@or_broken@Skipping file size check on NT4
1109 Passed: file size check on file123_ascii_copy [25]@or_broken@Skipping file size check on NT4
1110 Passed: file size check on file123_binary_copy [27]@or_broken@Skipping file size check on NT4
1111 Passed: file size check on file123_mixed_copy1 [26]@or_broken@Skipping file size check on NT4
1112 Passed: file size check on file123_mixed_copy2 [27]@or_broken@Skipping file size check on NT4
1113 Passed: file size check on file123_mixed_copy3 [26]@or_broken@Skipping file size check on NT4
1114 Passed: file size check on file123_mixed_copy4 [25]@or_broken@Skipping file size check on NT4
1115 Passed: file size check on file123_mixed_copy5 [28]@or_broken@Skipping file size check on NT4
1116 Passed: file size check on file123_mixed_copy6 [19]@or_broken@Skipping file size check on NT4
1117 Passed: file size check on file123_mixed_copy7 [6]@or_broken@Skipping file size check on NT4
1118 Passed: file size check on file123_mixed_copy8 [7]@or_broken@Skipping file size check on NT4
1119 Passed: errorlevel invalid check 1
1120 Passed: Did not find dir1\file1
1121 Passed: errorlevel invalid check 2
1122 Passed: errorlevel invalid check 3
1123 ------------ Testing setlocal/endlocal ------------
1124 --- enable/disable extensions
1125 @todo_wine@ErrLev:@space@
1128 @todo_wine@ErrLev:@space@@or_broken@ErrLev: 0
1130 --- setlocal with corresponding endlocal
1133 @pwd@\foobar\foobar2
1138 --- setlocal with no corresponding endlocal
1141 @pwd@\foobar\foobar2
1144 --- setlocal within same batch program
1157 --- Mismatched set and end locals
1158 --- Extra setlocal in called batch
1161 @pwd@\foobar\foodir3
1164 @pwd@\foobar\foodir2
1167 --- Extra endlocal in called batch
1170 @pwd@\foobar\foodir2
1172 @pwd@\foobar\foodir2
1175 @pwd@\foobar\foodir2
1178 --- endlocal in called function rather than batch pgm is ineffective
1187 ------------ Testing Errorlevel ------------
1190 errorlevel just right, good
1191 errorlevel with leading zero just right, good
1192 errorlevel with negative number OK
1193 abc0def@or_broken@abc1def
1194 errorlevel zero, good@or_broken@errorlevel nonzero, bad
1197 ------------ Testing GOTO ------------
1198 goto with no leading space worked
1199 goto with a leading space worked
1200 goto with a leading tab worked
1201 goto with a following space worked
1202 ------------ Testing PATH ------------
1206 ------------ Testing combined CALLs/GOTOs ------------