Add a testing suite for CMD based on CMD scripts.
[reactos.git] / rostests / win32 / cmd / script_testsuite / tests / set.cmd
1 ::
2 :: PROJECT: ReactOS CMD Testing Suite
3 :: LICENSE: GPL v2 or any later version
4 :: FILE: tests/set.cmd
5 :: PURPOSE: Tests for the "set" command
6 :: COPYRIGHT: Copyright 2005 Royce Mitchell III
7 :: Copyright 2008 Colin Finck <mail@colinfinck.de>
8 ::
9
10 :: Test the /A parameter
11 call :_test "set /a a=1"
12 call :_testvar %a% a 1
13
14 call :_test "set /a b=a"
15 call :_testvar %b% b 1
16
17 call :_test "set /a a=!5"
18 call :_testvar %a% a 0
19
20 call :_test "set /a a=!a"
21 call :_testvar %a% a 1
22
23 call :_test "set /a a=~5"
24 call :_testvar %a% a -6
25
26 call :_test "set /a a=5,a=-a"
27 call :_testvar %a% a -5
28
29 call :_test "set /a a=5*7"
30 call :_testvar %a% a 35
31
32 call :_test "set /a a=2000/10"
33 call :_testvar %a% a 200
34
35 call :_test "set /a a=42%%%%9"
36 call :_testvar %a% a 6
37
38 call :_test "set /a a=5%%2"
39 call :_testvar %a% a 5
40
41 call :_test "set /a a=42%13"
42 call :_testvar %a% a 423
43
44 call :_test "set /a a=7+9"
45 call :_testvar %a% a 16
46
47 call :_test "set /a a=9-7"
48 call :_testvar %a% a 2
49
50 set /a a=9^<^<2
51 call :_testvar %a% a 36
52
53 set /a a=36^>^>2
54 call :_testvar %a% a 9
55
56 set /a a=42^&9
57 call :_testvar %a% a 8
58
59 set /a a=32^9
60 call :_testvar %a% a 329
61
62 set /a a=32^^9
63 call :_testvar %a% a 41
64
65 set /a a=10^|22
66 call :_testvar %a% a 30
67
68 call :_test "set /a a=2,a*=3"
69 call :_testvar %a% a 6
70
71 call :_test "set /a a=11,a/=2"
72 call :_testvar %a% a 5
73
74 call :_test "set /a a=42,a%%%%=9"
75 call :_testvar %a% a 6
76
77 call :_test "set /a a=7,a+=9"
78 call :_testvar %a% a 16
79
80 call :_test "set /a a=9,a-=7"
81 call :_testvar %a% a 2
82
83 set /a a=42,a^&=9
84 call :_testvar %a% a 8
85
86 set /a a=32,a^^=9
87 call :_testvar %a% a 41
88
89 set /a a=10,a^|=22
90 call :_testvar %a% a 30
91
92 set /a a=9,a^<^<=2
93 call :_testvar %a% a 36
94
95 set /a a=36,a^>^>=2
96 call :_testvar %a% a 9
97
98 call :_test "set /a a=1,2"
99 call :_testvar %a% a 1
100
101 call :_test "set /a a=(a=1,a+2)"
102 call :_testvar %a% a 3
103
104 goto :EOF