Release 1.3.2.
[wine/gsoc-2012-control.git] / programs / cmd / tests / test_builtins.cmd
blobd596c18eec9c620b05345855d64e9b7092d50fa9
1 echo Tests for cmd's builtin commands
2 @echo off
4 echo ------------ Testing 'echo' --------------
5 echo word
6 echo 'singlequotedword'
7 echo "doublequotedword"
8 @echo at-echoed-word
9 echo "/?"
10 echo.
11 echo .
13 echo ------------ Testing 'set' --------------
14 echo set "FOO=bar" should not include the quotes in the variable value
15 set "FOO=bar"
16 echo %FOO%
18 echo ------------ Testing variable expansion --------------
19 echo ~dp0 should be directory containing batch file
20 echo %~dp0
21 mkdir dummydir
22 cd dummydir
23 echo %~dp0
24 cd ..
25 rmdir dummydir
26 echo CD value %CD%
27 echo %%
28 echo P%
29 echo %P
30 echo %UNKNOWN%S
31 echo P%UNKNOWN%
32 echo P%UNKNOWN%S
33 echo %ERRORLEVEL
34 echo %ERRORLEVEL%
35 echo %ERRORLEVEL%%ERRORLEVEL%
36 echo %ERRORLEVEL%ERRORLEVEL%
37 echo %ERRORLEVEL%%
38 echo %ERRORLEVEL%%%
39 echo P%ERRORLEVEL%
40 echo %ERRORLEVEL%S
41 echo P%ERRORLEVEL%S
43 echo ------------ Testing if/else --------------
44 echo if/else should work with blocks
45 if 0 == 0 (
46 echo if seems to work
47 ) else (
48 echo if seems to be broken
50 if 1 == 0 (
51 echo else seems to be broken
52 ) else (
53 echo else seems to work
55 echo Testing case sensitivity with and without /i option
56 if bar==BAR echo if does not default to case sensitivity
57 if not bar==BAR echo if seems to default to case sensitivity
58 if /i foo==FOO echo if /i seems to work
59 if /i not foo==FOO echo if /i seems to be broken
60 if /I foo==FOO echo if /I seems to work
61 if /I not foo==FOO echo if /I seems to be broken
63 echo -----------Testing GOTO-----------
64 if a==a goto dest1
65 :dest1
66 echo goto with no leading space worked
67 if b==b goto dest2
68 :dest2
69 echo goto with a leading space worked
70 if c==c goto dest3
71 :dest3
72 echo goto with a leading tab worked