cmd.exe: Fix /Y flag for move builtin.
[wine.git] / programs / cmd / tests / test_builtins.cmd.exp
blobf75839fdbe8a3871a95651fbf4dd9f04f72b37be
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] ------------
8 @pwd@>echo word@space@
9 word
11 @pwd@>echo 'singlequotedword'@space@
12 'singlequotedword'
14 @pwd@>echo "doublequotedword"@space@
15 "doublequotedword"
16 at-echoed-word
18 @pwd@>echo "/?"@space@
19 "/?"
21 @pwd@>echo.
24 @pwd@>echo .@space@
27 @pwd@>echo.word
28 word
30 @pwd@>echo .word@space@
31 .word
33 @pwd@>echo:
36 @pwd@>echo :@space@
39 @pwd@>echo:word
40 word
42 @pwd@>echo :word@space@
43 :word
45 @pwd@>echo/
48 @pwd@>echo /@space@
51 @pwd@>echo/word
52 word
54 @pwd@>echo /word@space@
55 /word
57 @pwd@>echo off now@space@
58 off now
60 @pwd@>echo word@space@@space@
61 word@space@
63 @pwd@>echo word@space@@space@@space@
64 word@space@@space@
66 @pwd@>echo word@space@
67 word
69 @pwd@>echo@tab@word@space@
70 word
72 @pwd@>echo@tab@word@space@@tab@@space@
73 word@space@@tab@
75 @pwd@>echo@tab@word@tab@@space@@space@
76 word@tab@@space@
78 @pwd@>echo word@space@
79 word
81 @pwd@>echo@space@@tab@word@space@
82 @tab@word
84 @pwd@>echo@space@@space@@tab@word@space@
85 @space@@tab@word
87 @pwd@>echo@tab@@tab@word@space@
88 @tab@word
90 @pwd@>echo @tab@ on @space@@space@
91 --- @ with chains and brackets
93 @todo_wine@@pwd@>(echo the @ character chains until && ) && echo and can hide brackets || () ||@space@
94 @todo_wine@the @ character chains until
95 @todo_wine@we leave the current depth
96 @todo_wine@and can hide brackets
97 @todo_wine@---
98 noecho1
99 noecho2
100 echo3
101 ------------ Testing 'echo' [OFF] ------------
102 word
103 'singlequotedword'
104 "doublequotedword"
105 at-echoed-word
106 "/?"
109 word
110 .word
113 word
114 :word
117 word
118 /word
119 on again
120 word@space@
121 word@space@@space@
122 word
123 word
124 word@space@@tab@
125 word@tab@@space@
126 word
127 @tab@word
128 @space@@tab@word
129 @tab@word
130 ------------ Testing mixed echo modes ------------
131 @echo on
132 if 1==1 echo foo
133 if 1==1 @echo bar
134 @echo off
135 if 1==1 echo foo2
136 if 1==1 @echo bar2
138 @todo_wine@@pwd@>if 1 == 1 echo foo@space@
141 @todo_wine@@pwd@>if 1 == 1@space@
143 foo2
144 bar2
145 ------------ Testing parameterization ------------
146 'a', 'b', 'c'
147 '"a b c"', '', ''
148 '"a b"\c', '', ''
149 'a', '~`+', '.{}!+b'
150 'a', 'b', ''
151 '"a;b"', '', ''
152 'a', 'b', ''
153 'a[b]{c}(d)e', '', ''
154 'a', '', ''
155 second line
156 'a', 'b', 'c'
157 'a', 'b', 'c'
158 'a', 'b', ''
159 ------------ Testing rem ------------
161 @pwd@>rem Hello@space@
163 @pwd@>rem Hello@space@
165 @pwd@>rem Hello || foo@space@
167 @pwd@>rem echo lol@space@
169 @pwd@>rem echo foo & echo bar@space@
171 @pwd@>rem @tab@ Hello@space@
173 @pwd@>rem@tab@ Hello@space@
175 @pwd@>rem@tab@echo foo & echo bar@space@
176 ------------ Testing redirection operators ------------
177 --- stdout redirection
179 foo@space@
180 foo@tab@
181 foo@space@
182 foo@tab@
183 foo7@space@@or_broken@foo@tab@
184 foo9@space@@or_broken@foo@tab@
185 foo1
186 foo11
187 foo12
188 foo13
189 foo14
190 foo15
191 --- stdout appending
193 foo@space@
194 foob@space@
195 foob@space@
196 fooc@space@
197 foob@space@
198 fooc@space@
199 food1
200 foob@space@
201 fooc@space@
202 food1
203 food2
204 food21
205 @todo_wine@foo7@space@@space@@or_broken@not supported@space@
206 @todo_wine@foo@or_broken@not supported
207 --- redirections within IF statements
208 foo1
209 foo2
210 -----
211 foo2
212 foo3
213 file does not exist, ok
214 foo4
215 baz5
216 baz6@space@
217 baz7
218 baz8
220 foo@space@
226 ------------ Testing circumflex escape character ------------
227 hello, world
228 hello, world
229 hell^o, world
230 hell^o, world
231 helloworld
232 hello
233 world
234 hello
236 finished
239 foo | echo bar
240 foo & echo bar
241 bak &
242 baz@space@
243 0@or_broken@1
244 foo > foo
246 ffoof
247 WINE_FOO=bar | baz
249 WINE_FOO=bar ^| baz
250 bar | baz
252 ------------ Testing chains ------------
253 --- chain success
259 @todo_wine@---
268 @todo_wine@---
277 @todo_wine@---
279 @todo_wine@j3
280 @todo_wine@---
282 @todo_wine@---
284 @todo_wine@---
285 --- chain failure
289 @todo_wine@---
297 @todo_wine@---
302 @todo_wine@g3
303 @todo_wine@---
305 @todo_wine@---
307 @todo_wine@i3
308 @todo_wine@---
314 @todo_wine@---
318 --- chain brackets
327 @todo_wine@---
336 @todo_wine@---
338 @todo_wine@---
340 @todo_wine@---
342 @todo_wine@---
348 @todo_wine@---
353 @todo_wine@---
355 @todo_wine@---
357 @todo_wine@---
363 @todo_wine@---
367 --- chain pipe
368 @todo_wine@a@space@
369 @todo_wine@a@space@
375 @todo_wine@---
381 @todo_wine@---
385 --- chain pipe input
386 a2:[a1,a2]
387 b3:[b2:[b1,b2],b3]@or_broken@b3:[b2:,b3]
388 c4:[c3:[c2:[c1,c2],c3],c4]@or_broken@c4:[c3:[c2:,c3],c4]@or_broken@c4:[c3:,c4]
389 d2:[d1,d2]
390 e3:[e2:[e1,e2],e3]@or_broken@e3:[e2:,e3]
391 f4:[f3:[f2:[f1,f2],f3],f4]@or_broken@f4:[f3:[f2:,f3],f4]@or_broken@f4:[f3:,f4]
392 --- chain else
395 @todo_wine@---
396 @todo_wine@c3
397 @todo_wine@---
398 @todo_wine@d3
399 @todo_wine@---
400 @todo_wine@---
401 @todo_wine@---
402 @todo_wine@---
403 @todo_wine@---
404 --- chain else (if true)
405 a1 else echo a2
406 b2 else echo b3
408 c2 else echo c3
410 @todo_wine@---
412 e2 else echo e3
414 g1 else echo g2
416 h1 else echo h2
417 @todo_wine@---
418 i1 else echo i2
420 @todo_wine@j2@space@
421 @todo_wine@---
425 @todo_wine@---
432 @todo_wine@---
433 --- chain else (if false)
443 @todo_wine@---
446 ------------ Testing 'set' ------------
449 WINE_FOOBAR not defined
451 WINE_FOOBAR = baz
453 baz2
456 WINE_FOOBAR= bar
457 WINE_FOOBAR = baz2
458 WINE_FOOBAR = baz2
459 WINE_FOOBAR not defined
462 foobar
463 WINE_FOO not defined
464 WINE_BAZ=bazbaz
465 bazbaz
466 set "WINE_FOO=bar" should not include the quotes in the variable value
470 'foo@space@'
471 'foo@tab@'
472 'value@space@'
473 'value'
474 'jim fred'
475 '"jim" fred'
476 'jim fred'
477 'jim'
478 'apple"banana"grape'
479 I'm here!@space@
480 I'm here!@space@
481 I'm here!@space@
482 ------------ Testing 'choice' ------------
483 @todo_wine@Example message [A,B,C]?A@or_broken@choice unavailable
484 @todo_wine@1@or_broken@9009
485 @todo_wine@Example message [A,B,C]?B@or_broken@choice unavailable
486 @todo_wine@2@or_broken@9009
487 @todo_wine@[D,E,F]?F@or_broken@choice unavailable
488 @todo_wine@3@or_broken@9009
489 @todo_wine@[A,B,C,X,Y,Z]?Y@or_broken@choice unavailable
490 @todo_wine@5@or_broken@9009
491 @todo_wine@A@or_broken@choice unavailable
492 @todo_wine@1@or_broken@9009
493 @todo_wine@[a,b,c,A,B,C]?A@or_broken@choice unavailable
494 @todo_wine@4@or_broken@9009
495 @todo_wine@255@or_broken@9009
496 ------------ Testing variable expansion ------------
497 ~p0 should be path containing batch file
498 @path@
499 @path@
500 ~dp0 should be directory containing batch file
501 @drive@@path@
502 @drive@@path@
503 CD value @pwd@@or_broken@CD value@space@
510 ERRORLEVEL
513 0ERRORLEVEL
519 ------------ Testing variable substrings ------------
523 'ty'@or_broken@''
524 't'@or_broken@''
525 ert@or_broken@qwerty
526 e@or_broken@qwerty
527 ''@or_broken@'qwerty'
528 r@or_broken@qwerty
529 ------------ Testing variable substitution ------------
530 --- in FOR variables
531 "A B"
533 "A B"
535 'A B'@or_broken@''
536 'C'@or_broken@''
537 @drive@@path@C D@or_broken@%~ff
538 @drive@@path@E@or_broken@%~ff
539 @drive@
540 @drive@
541 @path@@or_broken@%~pd
542 @path@@or_broken@%~pd
545 '.OOL'
546 '.TABC'
548 '@drive@@shortpath@R S'@or_broken@''
549 '@drive@@shortpath@T'@or_broken@''
550 '@drive@@shortpath@ABCDEFGHIJK.LMNOP'@or_broken@''
551 ''@or_broken@'%~ai'
552 ''@or_broken@'%~ai'
553 '--a------'@or_broken@'--a--------'@or_broken@'--a--c---'@or_broken@'%~ai'
554 '5'@or_broken@'%~zi'
555 ''@or_broken@'%~ti'
556 ''@or_broken@'%~ti'
557 ''@or_broken@'%~zi'
558 ''@or_broken@'%~zi'
559 @drive@@path@
560 @drive@@path@
561 @drive@
562 @drive@
563 @drive@
564 @drive@
566 '.eh'
567 ',,,,,,,,,'
568 --- in parameters
569 "A B"
571 'A B'@or_broken@''
572 'C'@or_broken@''
573 @drive@@path@C D
574 @drive@@path@E
575 @drive@
576 @drive@
577 @path@
578 @path@
581 '.OOL'
582 '.TABC'
584 '@drive@@shortpath@R S'@or_broken@''
585 '@drive@@shortpath@T'@or_broken@''
586 '@drive@@shortpath@ABCDEFGHIJK.LMNOP'@or_broken@''
587 @drive@@path@
588 @drive@@path@
589 @drive@
590 @drive@
591 @drive@
592 @drive@
594 '.eh'@or_broken@''
595 ------------ Testing parameter zero ------------
596 :func parm1
597 [:func] [@drive@] [@path@] [test] [.cmd] [@drive@@shortpath@test.cmd]
598 ------------ Testing variable delayed expansion ------------
599 --- default mode (load-time expansion)
601 !WINE_FOO!
604 --- runtime (delayed) expansion mode
606 foo@or_broken@!WINE_FOO!
608 bar@or_broken@foo
610 0@or_broken@1
612 !WINE_FOO!
613 --- using /V cmd flag
615 foo@or_broken@!WINE_FOO!
617 !WINE_FOO!
618 ------------ Testing conditional execution ------------
619 --- unconditional ampersand
620 foo1
621 bar2@space@
622 foo2
623 foobar deleted
624 --- on success conditional and
625 @todo_wine@foo3 not created
626 bar4@space@
627 foo4
628 --- on failure conditional or
629 foo5
630 foo6@space@
631 @todo_wine@------------ Testing cd ------------
632 singleFile
633 Current dir: @drive@@path@foobar@or_broken@Current dir:@space@
634 @drive@@path@foobar
635 @pwd@
636 @drive@@path@foobar
637 @pwd@
638 @drive@@path@foobar
639 @pwd@
640 @pwd@
641 @pwd@
642 @drive@@path@foobar\bar bak
643 @drive@@path@foobar\bar bak
644 @drive@@path@foobar\bar bak
645 @drive@@path@foobar\bar bak
646 @drive@@path@foobar\bar bak
647 @pwd@
648 @drive@@path@foobar
649 ------------ Testing type ------------
651 @pwd@>type foobaz@space@
654 @pwd@>echo ---@space@
657 ---1
659 ---2
661 ---3
662 ---4
663 ---5
666 ---6
668 foobaz
672 foobay
675 ---7
676 ------------ Testing NUL ------------
681 foo created
682 Passed: file size check on a.a [7]@or_broken@Skipping file size check on NT4
683 Passed: file size check on b.b [8]@or_broken@Skipping file size check on NT4
684 Passed: file size check on a.a [7]@or_broken@Skipping file size check on NT4
685 Passed: file size check on b.b [8]@or_broken@Skipping file size check on NT4
686 Passed: file size check on a.a [7]@or_broken@Skipping file size check on NT4
687 Passed: file size check on subdir\a.a [8]@or_broken@Skipping file size check on NT4
688 ------------ Testing if/else ------------
689 --- if/else should work with blocks
690 if seems to work
691 else seems to work
692 if seems not to detect /c as parameter
693 else if seems to work
694 else if seems to work
695 else if seems to work
696 expected1
697 expected post-embedded if
698 comparison operators surrounded by brackets seem to work
699 comparison operators surrounded by brackets seem to work
700 comparison operators surrounded by brackets seem to work
701 comparison operators surrounded by brackets seem to work
702 windir is defined
703 windir does exist
704 --- case sensitivity with and without /i option
705 if seems to default to case sensitivity
706 if /i seems to work
707 if /I seems to work
708 --- string comparisons
709 equal
710 non equal
711 non equal
712 equal
713 --- tabs handling
714 doom
715 doom
716 doom
718 quake
719 quake
720 quake
721 --- comparison operators
722 ------ for strings
723 LSS string can be used as operand for LSS comparison
724 floats are handled as strings
725 numbers in quotes are handled as strings
726 negative numbers as well@or_broken@NT4
727 if /i seems to work for LSS
728 A LSS B
729 A LSS AB
730 A LSS BA
731 A LSS AA
732 B LSS BA
733 AB LSS B
734 AB LSS BA
735 AA LSS B
736 AA LSS AB
737 AA LSS BA
738 b LSS B@or_broken@NT4
739 a LSS B@or_broken@NT4
740 a LSS B insensitive
741 A LSS b
742 A LSS b insensitive
743 A LEQ A
744 A LEQ B
745 A LEQ AB
746 A LEQ BA
747 A LEQ AA
748 B LEQ B
749 B LEQ BA
750 AB LEQ B
751 AB LEQ AB
752 AB LEQ BA
753 BA LEQ BA
754 AA LEQ B
755 AA LEQ AB
756 AA LEQ BA
757 AA LEQ AA
758 b LEQ B@or_broken@NT4
759 b LEQ B insensitive
760 a LEQ B@or_broken@NT4
761 a LEQ B insensitive
762 A LEQ b
763 A LEQ b insensitive
764 A EQU A
765 B EQU B
766 AB EQU AB
767 BA EQU BA
768 AA EQU AA
769 A EQU a insensitive
770 A NEQ B
771 A NEQ AB
772 A NEQ BA
773 A NEQ AA
774 B NEQ A
775 B NEQ AB
776 B NEQ BA
777 B NEQ AA
778 AB NEQ A
779 AB NEQ B
780 AB NEQ BA
781 AB NEQ AA
782 BA NEQ A
783 BA NEQ B
784 BA NEQ AB
785 BA NEQ AA
786 AA NEQ A
787 AA NEQ B
788 AA NEQ AB
789 AA NEQ BA
790 A GEQ A
791 B GEQ A
792 B GEQ B
793 B GEQ AB
794 B GEQ AA
795 AB GEQ A
796 AB GEQ AB
797 AB GEQ AA
798 BA GEQ A
799 BA GEQ B
800 BA GEQ AB
801 BA GEQ BA
802 BA GEQ AA
803 AA GEQ A
804 AA GEQ AA
805 B GTR A
806 B GTR AB
807 B GTR AA
808 AB GTR A
809 AB GTR AA
810 BA GTR A
811 BA GTR B
812 BA GTR AB
813 BA GTR AA
814 AA GTR A
815 ------------ Testing if/exist ------------
816 exist explicit works
817 exist explicit unknown file works
818 exist explicit in subdir works
819 exist simple wildcard works
820 exist wildcard works
821 negate exist wildcard works
822 exist wildcard bad subdir broken works
823 exist subdir ok
824 exist subdir with . ok
825 exist subdir with \ ok
826 exist subdir with \ and quotes ok
827 ------ for numbers
828 negative numbers handled
829 negative numbers handled
830 octal handled
831 also in negative form
832 hexa handled
833 also in negative form
834 11 LSS 101
835 0 LSS 1
836 0 LSS 10
837 0 LSS 9
838 1 LSS 10
839 1 LSS 9
840 9 LSS 10
841 0 LEQ 0
842 0 LEQ 1
843 0 LEQ 10
844 0 LEQ 9
845 1 LEQ 1
846 1 LEQ 10
847 1 LEQ 9
848 10 LEQ 10
849 9 LEQ 10
850 9 LEQ 9
851 0 EQU 0
852 1 EQU 1
853 10 EQU 10
854 9 EQU 9
855 octal ok
856 hexa ok
857 string/hexa compare ok
858 string/hexa compare ok
859 0 NEQ 1
860 0 NEQ 10
861 0 NEQ 9
862 1 NEQ 0
863 1 NEQ 10
864 1 NEQ 9
865 10 NEQ 0
866 10 NEQ 1
867 10 NEQ 9
868 9 NEQ 0
869 9 NEQ 1
870 9 NEQ 10
871 0 GEQ 0
872 1 GEQ 0
873 1 GEQ 1
874 10 GEQ 0
875 10 GEQ 1
876 10 GEQ 10
877 10 GEQ 9
878 9 GEQ 0
879 9 GEQ 1
880 9 GEQ 9
881 1 GTR 0
882 10 GTR 0
883 10 GTR 1
884 10 GTR 9
885 9 GTR 0
886 9 GTR 1
887 ------ for numbers and stringified numbers
888 strings and integers not equal
889 strings and integers not equal
891 "10" GEQ "1"
892 '1' GEQ 1@or_broken@NT4
893 1 GEQ "1"
894 "1" GEQ "1"
895 '1' GEQ "1"
896 "10" GEQ "1"
897 non NT4@or_broken@1 GEQ '1'
898 '1' GEQ '1'
900 1 GEQ "10"
902 '1' GEQ "10"
903 "10" GEQ "10"
904 --- unconditional ampersand after if one line
905 1@space@
906 2@space@
907 3 else echo 4
909 x@space@
911 x@space@
913 x@space@
915 x@space@
917 ------------ Testing for ------------
918 --- plain FOR
946 `echo
949 'echo
952 "echo A B"
953 "A B"
955 --- imbricated FORs
966 --- basic wildcards
967 bazbaz
968 --- wildcards in subdirs
969 pop\bar1@space@
970 pop\bar2.txt@space@
971 pop\bar3@space@
972 --- for /d
973 baz@space@
974 foo@space@
975 bar@space@
976 PASSED
977 xxx - Should be xxx
978 Expected second line
979 --- for /R
980 Plain directory enumeration
981 Plain directory enumeration from provided root
982 File enumeration
983 File enumeration from provided root
984 Mixed enumeration
985 Mixed enumeration from provided root
986 With duplicates enumeration
987 Strip missing wildcards, keep unwildcarded names
988 for /R passed
989 --- Complex wildcards unix and windows slash
990 Windows slashes, valid path
991 ASIS: foobar\baz\bazbaz
992 WC : foobar\baz\bazbaz
993 Windows slashes, invalid path
994 ASIS: foobar\jim\bazbaz
995 Unix slashes, valid path
996 ASIS: foobar/baz/bazbaz
997 WC : bazbaz
998 Unix slashes, invalid path
999 ASIS: foobar/jim/bazbaz
1000 Done
1001 --- for /L
1012 ErrorLevel 0
1013 ErrorLevel 0
1033 --- rems inside for loops
1034 --- ifs inside for loops
1047 --- set /a
1048 ------ individual operations
1049 WINE_foo correctly 3
1050 WINE_foo correctly -1
1051 WINE_foo correctly 3
1052 WINE_foo correctly 6
1053 WINE_foo correctly 10
1054 WINE_foo correctly 4
1055 WINE_foo correctly 4
1056 WINE_foo correctly -4
1057 WINE_foo correctly 0
1058 WINE_foo correctly 2
1059 WINE_foo correctly 2
1060 WINE_foo correctly -2
1061 WINE_foo correctly 1
1062 WINE_foo correctly 4
1063 WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly 1073741824 [0]
1064 WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly -1073741824 [0]
1065 WINE_foo correctly -4
1066 WINE_foo correctly 9
1067 WINE_foo correctly 2
1068 WINE_foo correctly 0
1069 WINE_foo correctly -1
1070 WINE_foo correctly -3
1071 WINE_foo correctly 0
1072 WINE_foo correctly 1
1073 WINE_foo correctly 1
1074 WINE_foo correctly 4
1075 WINE_foo correctly 1
1076 WINE_foo correctly 5
1077 WINE_foo correctly 5
1078 WINE_foo correctly 7
1079 WINE_foo correctly 5
1080 WINE_foo correctly 5
1081 WINE_foo correctly 5
1082 WINE_foo correctly 4
1083 WINE_foo correctly 6
1084 WINE_foo correctly 1
1085 WINE_foo correctly 4
1086 ------ precedence and grouping
1087 WINE_foo correctly 10
1088 WINE_foo correctly 18@or_broken@ERROR: WINE_foo incorrectly [18]
1089 WINE_foo correctly 2@or_broken@ERROR: WINE_foo incorrectly 0 [2]
1090 WINE_foo correctly 2@or_broken@ERROR: WINE_foo incorrectly [2]
1091 WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly 4 [0]
1092 WINE_foo correctly 4@or_broken@ERROR: WINE_foo incorrectly [4]
1093 WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly [3]
1094 WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly [3]
1095 ------ octal and hexadecimal
1096 WINE_foo correctly 18
1097 WINE_foo correctly 18
1098 WINE_foo correctly 15
1099 WINE_foo correctly 3
1100 ------ variables
1101 WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly 0 [3]
1102 WINE_bar correctly 3@or_broken@ERROR: WINE_bar incorrectly [3]
1103 WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly 0 [3]
1104 WINE_bar correctly 4@or_broken@ERROR: WINE_bar incorrectly [4]
1105 WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly 0 [3]
1106 WINE_bar correctly 3@or_broken@ERROR: WINE_bar incorrectly [3]
1107 WINE_baz correctly 4@or_broken@ERROR: WINE_baz incorrectly [4]
1108 WINE_foo correctly 9@or_broken@ERROR: WINE_foo incorrectly 3 [9]
1109 WINE_bar correctly 9@or_broken@ERROR: WINE_bar incorrectly 3 [9]
1110 WINE_foo correctly 0
1111 WINE_foo correctly 4
1112 WINE_bar correctly 4
1113 WINE_foo correctly -7@or_broken@ERROR: WINE_foo incorrectly 4 [-7]
1114 WINE_bar correctly -7@or_broken@ERROR: WINE_bar incorrectly 4 [-7]
1115 WINE_foo correctly -1@or_broken@ERROR: WINE_foo incorrectly -7 [-1]
1116 WINE_bar correctly -1@or_broken@ERROR: WINE_bar incorrectly -7 [-1]
1117 WINE_foo correctly 5@or_broken@ERROR: WINE_foo incorrectly 0 [5]
1118 WINE_bar correctly 1@or_broken@ERROR: WINE_bar incorrectly [1]
1119 WINE_foo correctly 4@or_broken@ERROR: WINE_foo incorrectly 1 [4]
1120 WINE_bar correctly 4@or_broken@ERROR: WINE_bar incorrectly 1 [4]
1121 WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly 4 [1]
1122 WINE_bar correctly 1@or_broken@ERROR: WINE_bar incorrectly 4 [1]
1123 WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly 1 [0]
1124 WINE_bar correctly 0@or_broken@ERROR: WINE_bar incorrectly 1 [0]
1125 WINE_foo correctly 5@or_broken@ERROR: WINE_foo incorrectly 0 [5]
1126 WINE_bar correctly 7@or_broken@ERROR: WINE_bar incorrectly [7]
1127 WINE_foo correctly 5@or_broken@ERROR: WINE_foo incorrectly 0 [5]
1128 WINE_bar correctly 7@or_broken@ERROR: WINE_bar incorrectly [7]
1129 WINE_foo correctly 19@or_broken@ERROR: WINE_foo incorrectly 0 [19]
1130 WINE_bar correctly 3@or_broken@ERROR: WINE_bar incorrectly [3]
1131 WINE_baz correctly 4
1132 --- quotes
1133 WINE_foo correctly 1
1134 WINE_foo correctly 1
1135 WINE_foo correctly 1
1136 WINE_bar correctly 2
1137 WINE_foo correctly 1
1138 WINE_bar correctly 2
1139 WINE_foo correctly 1
1140 WINE_bar correctly 2
1141 WINE_foo correctly 1
1142 WINE_bar correctly 2
1143 WINE_foo correctly 1
1144 WINE_bar correctly 2
1145 WINE_baz correctly 3
1146 WINE_foo correctly 1
1147 WINE_bar correctly 2
1148 WINE_baz correctly 3
1149 WINE_foo correctly 1
1150 WINE_bar correctly 2
1151 WINE_baz correctly 3
1152 WINE_foo correctly 1
1153 WINE_bar correctly 2
1154 WINE_baz correctly 3
1155 WINE_foo correctly 1
1156 WINE_bar correctly 2
1157 WINE_baz correctly 3
1158 WINE_foo correctly 1
1159 WINE_foo correctly 1
1160 WINE_bar correctly 5
1161 WINE_baz correctly 2
1162 WINE_foo correctly 18
1163 WINE_foo correctly 3
1164 WINE_bar correctly 7@or_broken@ERROR: WINE_bar incorrectly 4 [7]
1165 --- whitespace are ignored between double char operators
1166 WINE_foo correctly 10@or_broken@ERROR: WINE_foo incorrectly 4 [10]
1167 WINE_bar correctly 50@or_broken@ERROR: WINE_bar incorrectly 5 [50]
1168 WINE_foo correctly 772@or_broken@ERROR: WINE_foo incorrectly 4 [772]
1169 WINE_bar correctly 7720@or_broken@ERROR: WINE_bar incorrectly 5 [7720]
1170 --- invalid operator sequence
1173 ----- negative prefix
1174 WINE_foo correctly -1
1175 WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly [1]
1176 WINE_foo correctly 6
1177 WINE_foo correctly 0
1178 WINE_foo correctly 6
1179 WINE_foo correctly 2
1180 WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly [0]
1181 WINE_foo correctly 5
1182 WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly -5 [3]
1183 ----- assignment tests involving the end destination
1184 WINE_foo correctly 11@or_broken@ERROR: WINE_foo incorrectly 3 [11]
1185 WINE_foo correctly 6@or_broken@ERROR: WINE_foo incorrectly 2 [6]
1186 WINE_bar correctly 9@or_broken@ERROR: WINE_bar incorrectly [9]
1187 WINE_foo correctly 6@or_broken@ERROR: WINE_foo incorrectly 2 [6]
1188 WINE_bar correctly 10@or_broken@ERROR: WINE_bar incorrectly [10]
1189 WINE_baz correctly 7@or_broken@ERROR: WINE_baz incorrectly [7]
1190 WINE_foo correctly 7@or_broken@ERROR: WINE_foo incorrectly 2 [7]
1191 WINE_bar correctly 7@or_broken@ERROR: WINE_bar incorrectly 2 [7]
1192 ----- equal precedence on stack
1193 WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly 0 [1]
1194 WINE_foo correctly 0
1195 WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly [1]
1196 WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly [0]
1197 WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly [1]
1198 WINE_foo correctly -1@or_broken@ERROR: WINE_foo incorrectly [-1]
1199 WINE_foo correctly -1@or_broken@ERROR: WINE_foo incorrectly [-1]
1200 WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly [1]
1201 WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly [0]
1202 WINE_foo correctly -1
1203 WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly -1 [0]
1204 WINE_foo correctly 0
1205 WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly 0 [1]
1206 WINE_foo correctly -1@or_broken@ERROR: WINE_foo incorrectly 0 [-1]
1207 WINE_foo correctly 25@or_broken@ERROR: WINE_foo incorrectly 20 [25]
1208 WINE_foo correctly 20
1209 WINE_foo correctly 1
1210 WINE_foo correctly 4
1211 WINE_foo correctly 7
1212 WINE_foo correctly 8@or_broken@ERROR: WINE_foo incorrectly 4 [8]
1213 WINE_foo correctly 6@or_broken@ERROR: WINE_foo incorrectly 5 [6]
1214 WINE_bar correctly 6@or_broken@ERROR: WINE_bar incorrectly 5 [6]
1215 --- for /F
1216 ------ string argument
1219 a@or_broken@no output
1220 XaX@or_broken@no output
1222 a@or_broken@no output
1224 a@or_broken@no output
1226 a@or_broken@no output
1228 a@or_broken@no output
1229 ------ fileset argument
1230 --------- basic blank handling
1237 --------- multi-line with empty lines
1241 --------- multiple files
1252 ------ command argument
1253 Passed1@or_broken@Missing functionality - Broken1
1254 Passed2@or_broken@Missing functionality - Broken2
1255 Passed3@or_broken@Missing functionality - Broken3
1256 Passed4@or_broken@Missing functionality - Broken4
1257 Passed5@or_broken@Missing functionality - Broken5
1258 Passed6@or_broken@Missing functionality - Broken6
1259 Passed7@or_broken@Missing functionality - Broken7
1260 ------ eol option
1261 and@or_broken@Broken NT4 functionality1
1262 Line@or_broken@Broken NT4 functionality2
1263 Line@or_broken@Broken NT4 functionality3
1267 no output
1268 no output
1269 ------ delims option
1271 a@space@
1275 foo bar baz
1277 ------ skip option
1279 no output
1280 no output
1283 no output
1284 ------ tokens= option
1285 h=%h i=a j=%j k=%k l=%l m=%m o=%o
1286 h=%h i=b j=%j k=%k l=%l m=%m o=%o
1287 h=%h i=a j=c k=e l=f m=g o=%o
1288 h=%h i=a j=e k=f g l=%l m=%m o=%o
1289 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
1290 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
1291 h=%h i=a j=b k=c l=d e f g m=%m n=%n o=%o
1292 h=%h i=a j=b k=c l=d e f g m=%m n=%n o=%o
1293 h=%h i=a j=b k= l= m=%m n=%n o=%o
1294 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
1295 h=%h i=a j=b k= l= m= n=%n o=%o
1296 h=%h i=a j=b k= l= m= n= o=%o
1297 u=a v=b w=c x=d y=e z=f A=%A a=%a
1298 @todo_wine@U=a V=b W=c X=d Y=e Z=f A=%A a=m
1299 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
1300 h=%h i=e j=%j k=%k l=%l m=%m o=%o
1301 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
1302 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
1303 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
1304 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
1305 1:3.14,%B
1306 2:3.14,
1307 4:3,14
1308 ------ parameter splitting
1309 :forFParameterSplittingFunc myparam1=myvalue1 myparam2=myparam2 mytest@space@@space@@space@
1310 :forFParameterSplittingFunc myparam1=myvalue1 myparam2=myparam2 mytest@space@@space@@space@
1311 4:3.14,%B
1312 5:3,14
1313 6:14,
1314 ------------ Testing del ------------
1315 deleting 'file'
1316 errorlevel is 0, good
1317 successfully deleted 'file'
1318 attempting to delete 'file', even though it is not present
1319 errorlevel is 0, good
1320 ------------ Testing del /a ------------
1321 not-r.test not found after delete, good
1322 r.test found before delete, good
1323 r.test not found after delete, good
1324 ------------ Testing del /q ------------
1325 del /q * succeeded on file1
1326 del /q * succeeded on file2.dat
1327 ------------ Testing del /s ------------
1328 ------------ Testing rename ------------
1329 --- ren and rename are synonymous
1330 foo renamed to bar
1331 bar renamed to foo
1332 --- name collision
1335 --- rename read-only files
1336 read-only file renamed
1337 --- rename directories
1338 dir renamed
1339 read-only dir renamed
1340 --- rename in other directory
1341 rename impossible in other directory
1342 original file still present
1343 ------------ Testing move ------------
1344 --- file move
1345 file move succeeded
1346 file move with overwrite succeeded@or_broken@file overwrite impossible!
1347 bar@or_broken@baz
1348 read-only files are moveable
1349 file moved in subdirectory
1350 moving a file to itself is a no-op@or_broken@moving a file to itself should be a no-op!
1351 ErrorLevel: 0@or_broken@ErrorLevel: 1
1352 --- directory move
1353 simple directory move succeeded
1354 moving a directory to itself gives error; errlevel 1
1355 ------ dir in dir move
1357 bar2
1358 foo2
1359 ------------ Testing mkdir ------------
1360 --- md and mkdir are synonymous
1363 --- creating an already existing directory/file must fail
1366 --- multilevel path creation
1375 --- trailing backslashes
1377 dir created
1379 --- invalid chars
1380 mkdir ? gives errorlevel 1
1381 mkdir ?\foo gives errorlevel 1
1382 mkdir foo\? gives errorlevel 1
1383 ok, foo created
1384 mkdir foo\bar\? gives errorlevel 1
1385 ok, foo\bar created
1386 --- multiple directories at once
1387 foo created
1388 bar created
1389 foobar created
1390 bar\baz created
1391 bazbaz created
1392 zabzab created
1393 mkdir foo\* errorlevel 1
1394 ok, foo created
1395 ------------ Testing rmdir ------------
1397 dir removed
1399 dir removed
1402 file not removed
1404 non-empty dir not removed
1406 non-empty dir not removed
1407 recursive rmdir succeeded
1408 recursive rmdir succeeded
1409 foo removed
1410 bar removed
1411 foobar removed
1412 bar\baz removed
1413 ------------ Testing pushd/popd ------------
1414 @pwd@
1415 --- popd is no-op when dir stack is empty
1416 @pwd@
1417 --- pushing non-existing dir
1418 @pwd@
1419 --- basic behaviour
1420 @drive@@path@foobar
1421 @pwd@
1422 @drive@@path@foobar\baz
1423 @drive@@path@foobar
1424 @drive@@path@foobar
1425 @pwd@
1426 @drive@@path@foobar
1427 @pwd@
1428 ------------ Testing attrib ------------
1429 A@spaces@@drive@@path@foobar\foo@or_broken@A I@spaces@@drive@@path@foobar\foo
1430 --- read-only attribute
1431 A R@spaces@@drive@@path@foobar\foo@or_broken@A R I@spaces@@drive@@path@foobar\foo
1433 foo original contents
1434 Read-only file not deleted
1435 Read-only file forcibly deleted
1436 --- recursive behaviour
1437 A@spaces@@drive@@path@foobar\baz\level2@or_broken@A I@spaces@@drive@@path@foobar\baz\level2
1438 A R@spaces@@drive@@path@foobar\level1@or_broken@A R I@spaces@@drive@@path@foobar\level1
1439 A R@spaces@@drive@@path@foobar\baz\level2@or_broken@A R I@spaces@@drive@@path@foobar\baz\level2
1440 A@spaces@@drive@@path@foobar\bar@or_broken@A I@spaces@@drive@@path@foobar\bar
1441 --- folders processing
1442 @spaces@@drive@@path@foobar@or_broken@ I@spaces@@drive@@path@foobar
1443 @todo_wine@ R@spaces@@drive@@path@foobar\baz@or_broken@@spaces@@drive@@path@foobar\baz@or_broken@ R I@spaces@@drive@@path@foobar\baz
1444 A@spaces@@drive@@path@foobar\baz\toto@or_broken@A I@spaces@@drive@@path@foobar\baz\toto
1445 toto
1446 lulu
1447 file created in read-only dir
1448 ------------ Testing assoc ------------
1449 --- setting association
1451 .foo=bar
1452 .foo=bar
1454 .foo=bar
1455 --- resetting association
1459 ------------ Testing ftype ------------
1460 --- setting association
1462 footype=foo_opencmd
1463 .foo=footype
1464 footype=foo_opencmd
1466 footype=foo_opencmd
1467 --- resetting association
1468 @todo_wine@original value@or_broken@buggyXP@or_broken@!WINE_FOO!
1469 ------------ Testing CALL ------------
1470 --- external script
1471 foo@space@
1472 foo 8
1473 foo@space@@space@
1474 foo bar@space@
1475 foo ""@space@
1476 "" bar@space@
1477 foo ''@space@
1478 '' bar@space@
1479 --- internal routines
1480 bar :testRoutine
1481 foo@space@
1482 foo bar
1483 foo ""
1484 "" bar
1485 foo ''
1486 '' bar
1487 --- with builtins
1489 foo created
1490 Should expand foobaz
1491 batfile
1492 robinfile
1495 non-builtin dir
1496 Line one
1497 Line two
1498 Get if
1499 ... and else!
1500 passed
1501 ------------ Testing SHIFT ------------
1502 'p1' 'p2' 'p3' 'p4' 'p5'
1503 'p2' 'p3' 'p4' 'p5' ''
1504 'p3' 'p4' 'p5' '' ''
1505 'p3' 'p5' '' '' ''
1506 'p3' 'p5' '' '' ''
1507 'p5' '' '' '' ''
1508 ------------ Testing cmd invocation ------------
1509 --- a batch file can delete itself
1510 file correctly deleted
1511 --- a batch file can alter itself
1513 ---------- Testing copy
1514 Passed: Found expected dummy.file
1515 Passed: Found expected dir1\file1
1516 Passed: Found expected dir1\file1
1517 Passed: Found expected dir1\file99
1518 Passed: Found expected file1
1519 Passed: Did not find dir2
1520 Passed: Did not find dir2\file1
1521 Passed: Found expected dir1\file1
1522 Passed: Found expected dir1\file2
1523 Passed: Found expected dir1\file3
1524 Passed: Found expected dir1\file1
1525 Passed: Found expected dir1\file2
1526 Passed: Found expected dir1\file3
1527 Passed: Found expected file1
1528 Passed: Found expected file2
1529 Passed: Found expected file3
1530 Passed: Did not find dir2
1531 Passed: Did not find dir2\file1
1532 Passed: Did not find dir2\file2
1533 Passed: Did not find dir2\file3
1534 Passed: Found expected testfile
1535 Passed: Found expected testfile
1536 Passed: Found expected testfile
1537 Passed: Found expected testfile
1538 Passed: Found expected testfile
1539 Passed: Found expected dir1\fred
1540 Passed: Found expected dir1\fred
1541 Passed: Found expected fred
1542 Passed: Found expected fred
1543 Passed: file size check on file1 [5]@or_broken@Skipping file size check on NT4
1544 Passed: file size check on file2 [8]@or_broken@Skipping file size check on NT4
1545 Passed: file size check on file3 [11]@or_broken@Skipping file size check on NT4
1546 Passed: file size check on file1_default [5]@or_broken@Skipping file size check on NT4
1547 Passed: file size check on file1_default2 [5]@or_broken@Skipping file size check on NT4
1548 Passed: file size check on file1_plus_eof [6]@or_broken@Skipping file size check on NT4
1549 Passed: file size check on file2_plus_eof [9]@or_broken@Skipping file size check on NT4
1550 Passed: file size check on file3_plus_eof [12]@or_broken@Skipping file size check on NT4
1551 Passed: file size check on file12_plus_eof [14]@or_broken@Skipping file size check on NT4
1552 Passed: file size check on file12_no_eof [13]@or_broken@Skipping file size check on NT4
1553 Passed: file size check on file12_eof2 [14]@or_broken@Skipping file size check on NT4
1554 Passed: file size check on file1 [24]@or_broken@Skipping file size check on NT4
1555 Passed: file size check on file2 [16]@or_broken@Skipping file size check on NT4
1556 Passed: file size check on file3 [13]@or_broken@Skipping file size check on NT4
1557 Passed: file size check on file1_binary_srccopy [6]@or_broken@Skipping file size check on NT4
1558 Passed: file size check on file1_ascii_srccopy [5]@or_broken@Skipping file size check on NT4
1559 Passed: file size check on file123_default_copy [25]@or_broken@Skipping file size check on NT4
1560 Passed: file size check on file123_ascii_copy [25]@or_broken@Skipping file size check on NT4
1561 Passed: file size check on file123_binary_copy [27]@or_broken@Skipping file size check on NT4
1562 Passed: file size check on file123_mixed_copy1 [26]@or_broken@Skipping file size check on NT4
1563 Passed: file size check on file123_mixed_copy2 [27]@or_broken@Skipping file size check on NT4
1564 Passed: file size check on file123_mixed_copy3 [26]@or_broken@Skipping file size check on NT4
1565 Passed: file size check on file123_mixed_copy4 [25]@or_broken@Skipping file size check on NT4
1566 Passed: file size check on file123_mixed_copy5 [28]@or_broken@Skipping file size check on NT4
1567 Passed: file size check on file123_mixed_copy6 [19]@or_broken@Skipping file size check on NT4
1568 Passed: file size check on file123_mixed_copy7 [6]@or_broken@Skipping file size check on NT4
1569 Passed: file size check on file123_mixed_copy8 [7]@or_broken@Skipping file size check on NT4
1570 Passed: errorlevel invalid check 1
1571 Passed: Did not find dir1\file1
1572 Passed: errorlevel invalid check 2
1573 Passed: errorlevel invalid check 3
1574 ------------ Testing setlocal/endlocal ------------
1575 --- enable/disable extensions
1576 @todo_wine@ErrLev:@space@
1577 ErrLev: 0
1578 ErrLev: 0
1579 @todo_wine@ErrLev:@space@@or_broken@ErrLev: 0
1580 ErrLev: 0
1581 --- setlocal with corresponding endlocal
1582 globalval
1583 localval
1584 @drive@@path@foobar\foobar2
1585 globalval
1586 @drive@@path@foobar
1587 globalval
1588 @drive@@path@foobar
1589 --- setlocal with no corresponding endlocal
1590 globalval
1591 localval
1592 @drive@@path@foobar\foobar2
1593 globalval
1594 @drive@@path@foobar
1595 --- setlocal within same batch program
1596 Var1 ok 1
1597 Var2 ok 2
1598 Var3 ok 3
1599 Directory is ok 1
1600 Var1 ok 1
1601 Var2 ok 2
1602 Var3 ok 3
1603 Directory is ok 2
1604 Var1 ok 1
1605 Var2 ok 2
1606 Var3 ok 3
1607 Directory is ok 3
1608 --- Mismatched set and end locals
1609 --- Extra setlocal in called batch
1610 value2
1611 2set1endvalue1
1612 @drive@@path@foobar\foodir3
1613 Finished:
1614 value2
1615 @drive@@path@foobar\foodir2
1616 value1
1617 @drive@@path@foobar
1618 --- Extra endlocal in called batch
1619 value2
1620 value2
1621 @drive@@path@foobar\foodir2
1622 value2
1623 @drive@@path@foobar\foodir2
1624 Finished:
1625 value2
1626 @drive@@path@foobar\foodir2
1627 value1
1628 @drive@@path@foobar
1629 --- endlocal in called function rather than batch pgm is ineffective
1638 ------------ Testing Errorlevel ------------
1639 9009
1641 errorlevel just right, good
1642 errorlevel with leading zero just right, good
1643 errorlevel with negative number OK
1644 abc0def@or_broken@abc1def
1645 errorlevel zero, good@or_broken@errorlevel nonzero, bad
1646 7 should be 7
1647 7 should still be 7
1648 ------------ Testing GOTO ------------
1649 goto with no leading space worked
1650 goto with colon and no leading space worked
1651 goto with a leading space worked
1652 goto with a leading tab worked
1653 goto with a following space worked
1654 goto with following amphersands worked
1655 goto with redirections worked
1656 Ignoring double colons worked
1657 label with mixed whitespace and no echo worked
1658 Correctly ignored trailing information
1659 Begin:
1660 ..First sub
1661 ..First sub
1662 Middle:
1663 ..Third sub
1664 ..Third sub
1665 Near end:
1666 ..Fourth sub
1667 ..Fourth sub
1668 At end:
1669 ..First sub
1670 ..First sub
1671 Finished
1672 ------------ Testing PATH ------------
1673 PATH=original
1674 PATH=try2
1675 PATH=try3
1676 ------------ Testing start /W ------------
1677 start /W seems to really wait
1678 ------------ Testing changing the drive letter ----------
1679 Normal:
1680 Normal+space
1681 Normal+space+garbage
1682 Quoted should fail
1683 Normal+tab
1684 Normal+tab+garbage
1685 ------------ Testing combined CALLs/GOTOs ------------
1686 world
1687 cheball
1688 barbare
1692 cheball
1693 barbare