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 ------------
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 floats are handled as strings
445 numbers in quotes are handled as strings
446 negative numbers as well@or_broken@NT4
447 if /i seems to work for LSS
458 b LSS B@or_broken@NT4
459 a LSS B@or_broken@NT4
478 b LEQ B@or_broken@NT4
480 a LEQ B@or_broken@NT4
536 negative numbers handled
537 negative numbers handled
539 also in negative form
541 also in negative form
565 string/hexa compare ok
566 string/hexa compare ok
595 ------ for numbers and stringified numbers
596 strings and integers not equal
597 strings and integers not equal
600 '1' GEQ 1@or_broken@NT4
605 non NT4@or_broken@1 GEQ '1'
612 ------------ Testing for ------------
671 Plain directory enumeration
672 Plain directory enumeration from provided root
674 File enumeration from provided root
676 Mixed enumeration from provided root
677 With duplicates enumeration
678 Strip missing wildcards, keep unwildcarded names
713 ------ individual operations
729 0@or_broken@1073741824
730 0@or_broken@-1073741824
751 ------ precedence and grouping
754 @todo_wine@18@or_broken@10
755 @todo_wine@2@or_broken@0
756 @todo_wine@2@or_broken@0
759 @todo_wine@3@or_broken@4
760 ------ octal and hexadecimal
761 @todo_wine@3@or_broken@4
767 @todo_wine@3@or_broken@foo not defined
768 @todo_wine@3@or_broken@0
769 @todo_wine@3@or_broken@0
770 @todo_wine@3@or_broken@0
771 @todo_wine@9@or_broken@0
773 @todo_wine@4@or_broken@0
774 @todo_wine@-7@or_broken@0
775 @todo_wine@-1@or_broken@0
776 @todo_wine@5@or_broken@0
777 @todo_wine@4@or_broken@0
778 @todo_wine@1@or_broken@0
780 @todo_wine@5@or_broken@0
783 ------ string argument
785 a@or_broken@no output
787 a@or_broken@no output
789 a@or_broken@no output
791 a@or_broken@no output
793 a@or_broken@no output
794 ------ fileset argument
795 --------- basic blank handling
802 --------- multi-line with empty lines
806 --------- multiple files
817 ------ command argument
818 Passed1@or_broken@Missing functionality - Broken1
819 Passed2@or_broken@Missing functionality - Broken2
820 Passed3@or_broken@Missing functionality - Broken3
822 and@or_broken@Broken NT4 functionality1
823 Line@or_broken@Broken NT4 functionality2
824 Line@or_broken@Broken NT4 functionality3
845 ------------ Testing del /a ------------
846 not-r.test not found after delete, good
847 r.test found before delete, good
848 r.test not found after delete, good
849 ------------ Testing del /q ------------
850 del /q * succeeded on file1
851 del /q * succeeded on file2.dat
852 ------------ Testing del /s ------------
853 ------------ Testing rename ------------
854 --- ren and rename are synonymous
860 --- rename read-only files
861 read-only file renamed
862 --- rename directories
864 read-only dir renamed
865 --- rename in other directory
866 rename impossible in other directory
867 original file still present
868 ------------ Testing move ------------
871 @todo_wine@file move with overwrite succeeded@or_broken@file overwrite impossible!
872 @todo_wine@bar@or_broken@baz
873 read-only files are moveable
874 file moved in subdirectory
875 @todo_wine@moving a file to itself is a no-op@or_broken@moving a file to itself should be a no-op!
876 @todo_wine@ErrorLevel: 0@or_broken@ErrorLevel: 1
878 simple directory move succeeded
879 moving a directory to itself gives error; errlevel 1
880 ------ dir in dir move
884 ------------ Testing mkdir ------------
885 --- md and mkdir are synonymous
888 --- creating an already existing directory/file must fail
891 --- multilevel path creation
900 --- trailing backslashes
905 mkdir ? gives errorlevel 1
906 mkdir ?\foo gives errorlevel 1
907 mkdir foo\? gives errorlevel 1
909 mkdir foo\bar\? gives errorlevel 1
911 --- multiple directories at once
918 mkdir foo\* errorlevel 1
920 ------------ Testing rmdir ------------
929 non-empty dir not removed
931 non-empty dir not removed
932 recursive rmdir succeeded
933 recursive rmdir succeeded
938 ------------ Testing pushd/popd ------------
940 --- popd is no-op when dir stack is empty
942 --- pushing non-existing dir
953 ------------ Testing attrib ------------
954 A @pwd@\foobar\foo@or_broken@A @pwd@\foobar\foo@or_broken@A I @pwd@\foobar\foo
955 --- read-only attribute
956 A R @pwd@\foobar\foo@or_broken@A R @pwd@\foobar\foo@or_broken@A R I @pwd@\foobar\foo
958 foo original contents
959 Read-only file not deleted
960 Read-only file forcibly deleted
961 --- recursive behaviour
962 A @pwd@\foobar\baz\level2@or_broken@A @pwd@\foobar\baz\level2@or_broken@A I @pwd@\foobar\baz\level2
963 A R @pwd@\foobar\level1@or_broken@A R @pwd@\foobar\level1@or_broken@A R I @pwd@\foobar\level1
964 A R @pwd@\foobar\baz\level2@or_broken@A R @pwd@\foobar\baz\level2@or_broken@A R I @pwd@\foobar\baz\level2
965 A @pwd@\foobar\bar@or_broken@A @pwd@\foobar\bar@or_broken@A I @pwd@\foobar\bar
966 --- folders processing
967 @pwd@\foobar@or_broken@ @pwd@\foobar@or_broken@ I @pwd@\foobar
968 @todo_wine@ R @pwd@\foobar\baz@or_broken@ R @pwd@\foobar\baz@or_broken@ @pwd@\foobar\baz@or_broken@ R I @pwd@\foobar\baz
969 A @pwd@\foobar\baz\toto@or_broken@A @pwd@\foobar\baz\toto@or_broken@A I @pwd@\foobar\baz\toto
972 file created in read-only dir
973 ------------ Testing assoc ------------
974 --- setting association
980 --- resetting association
984 ------------ Testing ftype ------------
985 --- setting association
992 --- resetting association
993 @todo_wine@original value@or_broken@buggyXP@or_broken@!FOO!
994 ------------ Testing CALL ------------
1004 --- internal routines
1015 Should expand foobaz
1026 ------------ Testing SHIFT ------------
1027 'p1' 'p2' 'p3' 'p4' 'p5'
1028 'p2' 'p3' 'p4' 'p5' ''
1029 'p3' 'p4' 'p5' '' ''
1033 ------------ Testing cmd invocation ------------
1034 --- a batch file can delete itself
1035 file correctly deleted
1036 --- a batch file can alter itself
1038 ---------- Testing copy
1039 Passed: Found expected dummy.file
1040 Passed: Found expected dir1\file1
1041 Passed: Found expected dir1\file1
1042 Passed: Found expected dir1\file99
1043 Passed: Found expected file1
1044 Passed: Did not find dir2
1045 Passed: Did not find dir2\file1
1046 Passed: Found expected dir1\file1
1047 Passed: Found expected dir1\file2
1048 Passed: Found expected dir1\file3
1049 Passed: Found expected dir1\file1
1050 Passed: Found expected dir1\file2
1051 Passed: Found expected dir1\file3
1052 Passed: Found expected file1
1053 Passed: Found expected file2
1054 Passed: Found expected file3
1055 Passed: Did not find dir2
1056 Passed: Did not find dir2\file1
1057 Passed: Did not find dir2\file2
1058 Passed: Did not find dir2\file3
1059 Passed: Found expected testfile
1060 Passed: Found expected testfile
1061 Passed: Found expected testfile
1062 Passed: Found expected testfile
1063 Passed: Found expected testfile
1064 Passed: Found expected dir1\fred
1065 Passed: Found expected dir1\fred
1066 Passed: Found expected fred
1067 Passed: Found expected fred
1068 Passed: file size check on file1 [5]@or_broken@Skipping file size check on NT4
1069 Passed: file size check on file2 [8]@or_broken@Skipping file size check on NT4
1070 Passed: file size check on file3 [11]@or_broken@Skipping file size check on NT4
1071 Passed: file size check on file1_default [5]@or_broken@Skipping file size check on NT4
1072 Passed: file size check on file1_default2 [5]@or_broken@Skipping file size check on NT4
1073 Passed: file size check on file1_plus_eof [6]@or_broken@Skipping file size check on NT4
1074 Passed: file size check on file2_plus_eof [9]@or_broken@Skipping file size check on NT4
1075 Passed: file size check on file3_plus_eof [12]@or_broken@Skipping file size check on NT4
1076 Passed: file size check on file12_plus_eof [14]@or_broken@Skipping file size check on NT4
1077 Passed: file size check on file12_no_eof [13]@or_broken@Skipping file size check on NT4
1078 Passed: file size check on file12_eof2 [14]@or_broken@Skipping file size check on NT4
1079 Passed: file size check on file1_binary_srccopy [6]@or_broken@Skipping file size check on NT4
1080 Passed: file size check on file1_ascii_srccopy [5]@or_broken@Skipping file size check on NT4
1081 Passed: file size check on file123_default_copy [25]@or_broken@Skipping file size check on NT4
1082 Passed: file size check on file123_ascii_copy [25]@or_broken@Skipping file size check on NT4
1083 Passed: file size check on file123_binary_copy [27]@or_broken@Skipping file size check on NT4
1084 Passed: file size check on file123_mixed_copy1 [26]@or_broken@Skipping file size check on NT4
1085 Passed: file size check on file123_mixed_copy2 [27]@or_broken@Skipping file size check on NT4
1086 Passed: file size check on file123_mixed_copy3 [26]@or_broken@Skipping file size check on NT4
1087 Passed: file size check on file123_mixed_copy4 [25]@or_broken@Skipping file size check on NT4
1088 Passed: file size check on file123_mixed_copy5 [28]@or_broken@Skipping file size check on NT4
1089 Passed: file size check on file123_mixed_copy6 [19]@or_broken@Skipping file size check on NT4
1090 Passed: file size check on file123_mixed_copy7 [6]@or_broken@Skipping file size check on NT4
1091 Passed: file size check on file123_mixed_copy8 [7]@or_broken@Skipping file size check on NT4
1092 Passed: errorlevel invalid check 1
1093 Passed: Did not find dir1\file1
1094 Passed: errorlevel invalid check 2
1095 Passed: errorlevel invalid check 3
1096 ------------ Testing setlocal/endlocal ------------
1097 --- enable/disable extensions
1098 @todo_wine@ErrLev:@space@
1101 @todo_wine@ErrLev:@space@@or_broken@ErrLev: 0
1103 --- setlocal with corresponding endlocal
1106 @pwd@\foobar\foobar2
1111 --- setlocal with no corresponding endlocal
1114 @pwd@\foobar\foobar2
1117 --- setlocal within same batch program
1130 --- Mismatched set and end locals
1131 --- Extra setlocal in called batch
1134 @pwd@\foobar\foodir3
1137 @pwd@\foobar\foodir2
1140 --- Extra endlocal in called batch
1143 @pwd@\foobar\foodir2
1145 @pwd@\foobar\foodir2
1148 @pwd@\foobar\foodir2
1151 --- endlocal in called function rather than batch pgm is ineffective
1160 ------------ Testing Errorlevel ------------
1163 errorlevel just right, good
1164 errorlevel with leading zero just right, good
1165 errorlevel with negative number OK
1166 abc0def@or_broken@abc1def
1167 errorlevel zero, good@or_broken@errorlevel nonzero, bad
1170 ------------ Testing GOTO ------------
1171 goto with no leading space worked
1172 goto with a leading space worked
1173 goto with a leading tab worked
1174 goto with a following space worked
1175 ------------ Testing PATH ------------
1179 ------------ Testing combined CALLs/GOTOs ------------