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 @todo_wine@@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 @todo_wine@@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@
77 ------------ Testing
'echo' [OFF] --------------
102 ------------ Testing
rem --------------
104 @pwd@
>rem Hello@space@
106 @pwd@
>rem Hello@space@
108 @pwd@
>rem Hello || foo@space@
110 @pwd@
>rem echo lol@space@
112 @pwd@
>rem echo foo
& echo bar@space@
114 @pwd@
>rem @tab@ Hello@space@
116 @pwd@
>rem@tab@ Hello@space@
118 @pwd@
>rem@tab@echo foo
& echo bar@space@
119 ------------ Testing redirection operators
--------------
120 ...stdout redirection
135 @todo_wine@foob@space@
136 @todo_wine@fooc@space@
140 @todo_wine@
------------ Testing ^ escape character
--------------
141 @todo_wine@hello
, world
142 @todo_wine@hello
, world
143 @todo_wine@hell^o
, world
144 @todo_wine@hell^o
, world
147 @todo_wine@foo | echo bar
148 @todo_wine@foo
& echo bar
150 @todo_wine@baz@space@
151 @todo_wine@
0@or_broken@
1
155 @todo_wine@FOO
=bar | baz
157 @todo_wine@FOO
=bar ^| baz
160 ------------ Testing
'set' --------------
170 @todo_wine@FOOBAR
= bar
171 @todo_wine@FOOBAR
= baz2
180 set "FOO=bar" should not include the quotes in the variable value
186 ------------ Testing
variable expansion
--------------
187 ~dp0 should be directory containing batch file
190 CD value @pwd@@or_broken@CD value@space@
206 ------------ Testing
variable substrings
--------------
210 @todo_wine@
'ty'@or_broken@
''
214 ''@or_broken@
'qwerty'
216 ------------ Testing
variable delayed expansion
--------------
217 ...default
mode (load-time expansion
)
222 ...runtime
(delayed
) expansion
mode
224 @todo_wine@foo@or_broken@
!FOO
!
226 @todo_wine@bar@or_broken@foo
233 @todo_wine@foo@or_broken@
!FOO
!
236 ------------ Testing conditional execution
--------------
237 @todo_wine@...unconditional
&
241 @todo_wine@foobar deleted
242 @todo_wine@...
on success conditional
&&
243 @todo_wine@foo3 not created
246 @todo_wine@...
on failure conditional ||
248 @todo_wine@foo6@space@
249 ------------ Testing cd
------------
251 Current
dir: @pwd@
\foobar@or_broken@Current
dir:@space@
265 ------------ Testing type
------------
267 @pwd@
>type foobaz@space@
270 @pwd@
>echo
***@space@
274 ------------ Testing NUL
------------
279 @todo_wine@foo created
280 ------------ Testing
if/else --------------
281 if/else should work with blocks
284 @todo_wine@
if seems not to detect
/c as parameter
285 Testing case sensitivity with and without
/i option
286 if seems to default to case sensitivity
296 -----------Testing
for -----------
353 @todo_wine@ErrorLevel
0
354 @todo_wine@ErrorLevel
0
356 ......individual operations
372 0@or_broken@
1073741824
373 0@or_broken@
-1073741824
394 ......precedence and grouping
397 @todo_wine@
18@or_broken@
10
398 @todo_wine@
2@or_broken@
0
399 @todo_wine@
2@or_broken@
0
402 @todo_wine@
3@or_broken@
4
403 ......octal and hexadecimal
404 @todo_wine@
3@or_broken@
4
410 @todo_wine@
3@or_broken@foo not defined
411 @todo_wine@
3@or_broken@
0
412 @todo_wine@
3@or_broken@
0
413 @todo_wine@
3@or_broken@
0
414 @todo_wine@
9@or_broken@
0
416 @todo_wine@
4@or_broken@
0
417 @todo_wine@
-7@or_broken@
0
418 @todo_wine@
-1@or_broken@
0
419 @todo_wine@
5@or_broken@
0
420 @todo_wine@
4@or_broken@
0
421 @todo_wine@
1@or_broken@
0
423 @todo_wine@
5@or_broken@
0
425 -----------Testing del
/a
-----------
426 not
-r.test not found after
delete, good
427 r.test found before
delete, good
428 r.test not found after
delete, good
429 ------------ Testing del
/q
--------------
430 del
/q
* succeeded
on file1
431 del
/q
* succeeded
on file2.dat
432 ------------ Testing del
/s
--------------
433 ----------- Testing
mkdir -----------
449 mkdir ? gives errorlevel
1
450 mkdir ?
\foo gives errorlevel
1
451 mkdir foo
\? gives errorlevel
1
453 mkdir foo
\bar
\? gives errorlevel
1
459 mkdir foo\
* errorlevel
1
461 ----------- Testing
rmdir -----------
470 non
-empty
dir not removed
472 non
-empty
dir not removed
473 recursive rmdir succeeded
474 recursive rmdir succeeded
479 ------------ Testing attrib
--------------
480 @todo_wine@A @pwd@
\foobar
\foo@or_broken@A @pwd@
\foobar
\foo@or_broken@A I @pwd@
\foobar
\foo
481 ... read
-only attribute
482 @todo_wine@A R @pwd@
\foobar
\foo@or_broken@A R @pwd@
\foobar
\foo@or_broken@A R I @pwd@
\foobar
\foo
484 foo original contents
485 Read
-only file not deleted
486 Read
-only file forcibly deleted
487 ...
recursive behaviour
488 @todo_wine@A @pwd@
\foobar
\baz\level2@or_broken@A @pwd@
\foobar
\baz\level2@or_broken@A I @pwd@
\foobar
\baz\level2
489 @todo_wine@A R @pwd@
\foobar\level1@or_broken@A R @pwd@
\foobar\level1@or_broken@A R I @pwd@
\foobar\level1
490 @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
491 @todo_wine@A @pwd@
\foobar
\bar@or_broken@A @pwd@
\foobar
\bar@or_broken@A I @pwd@
\foobar
\bar
492 ... folders processing
493 @todo_wine@ @pwd@
\foobar@or_broken@ @pwd@
\foobar@or_broken@ I @pwd@
\foobar
494 @todo_wine@ R @pwd@
\foobar
\baz@or_broken@ R @pwd@
\foobar
\baz@or_broken@ @pwd@
\foobar
\baz@or_broken@ R I @pwd@
\foobar
\baz
495 @todo_wine@A @pwd@
\foobar
\baz
\toto@or_broken@A @pwd@
\foobar
\baz
\toto@or_broken@A I @pwd@
\foobar
\baz
\toto
498 file created in read
-only
dir
499 ------------ Testing
CALL --------------
504 @todo_wine@foo
""@space@
505 @todo_wine@
"" bar@space@
516 @todo_wine@foo created
517 @todo_wine@Should expand foobaz
523 ------------ Testing setlocal
/endlocal
------------
524 ...enable
/disable extensions
525 @todo_wine@ErrLev
:@space@
528 @todo_wine@ErrLev
:@space@@or_broken@ErrLev
: 0
530 ...setlocal with corresponding endlocal
535 ...setlocal with no corresponding endlocal
539 -----------Testing Errorlevel
-----------
542 errorlevel just right
, good
543 abc0def@or_broken@abc1def
544 errorlevel zero
, good@or_broken@errorlevel nonzero
, bad
547 -----------Testing
GOTO-----------
548 goto with no leading space worked
549 goto with a leading space worked
550 goto with a leading tab worked
551 goto with a following space worked
552 -----------Done
, jumping to EOF
-----------