Operators unittests
This commit is contained in:
parent
e14931f389
commit
07352a16a3
15
unittests/operators_float.chai
Normal file
15
unittests/operators_float.chai
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
var i = 1.0;
|
||||||
|
var j = 2.0;
|
||||||
|
var k = 3.0;
|
||||||
|
|
||||||
|
print(i + j);
|
||||||
|
print(+i);
|
||||||
|
print(i - j);
|
||||||
|
print(-i);
|
||||||
|
print(k / j);
|
||||||
|
print(j * k);
|
||||||
|
|
||||||
|
print(i -= 1);
|
||||||
|
print(j *= 1.5);
|
||||||
|
print(j /= 2);
|
||||||
|
print(j += 1);
|
10
unittests/operators_float.txt
Normal file
10
unittests/operators_float.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
3
|
||||||
|
1
|
||||||
|
-1
|
||||||
|
-1
|
||||||
|
1.5
|
||||||
|
6
|
||||||
|
0
|
||||||
|
3
|
||||||
|
1.5
|
||||||
|
2.5
|
32
unittests/operators_int.chai
Normal file
32
unittests/operators_int.chai
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
var i = 1;
|
||||||
|
var j = 2;
|
||||||
|
var k = 3;
|
||||||
|
|
||||||
|
print(i + j);
|
||||||
|
print(+i);
|
||||||
|
print(i - j);
|
||||||
|
print(-i);
|
||||||
|
print(j & k);
|
||||||
|
print(~j);
|
||||||
|
print(j ^ k);
|
||||||
|
print(i | j);
|
||||||
|
print(j / i);
|
||||||
|
print(i << j);
|
||||||
|
print(j * k);
|
||||||
|
print(k % j);
|
||||||
|
print(j >> i);
|
||||||
|
|
||||||
|
print(i &= 2);
|
||||||
|
print(j ^= 3);
|
||||||
|
print(j |= 2);
|
||||||
|
print(i -= 1);
|
||||||
|
print(j <<= 1);
|
||||||
|
print(j *= 2);
|
||||||
|
print(j /= 2);
|
||||||
|
print(j %= 4);
|
||||||
|
print(j >>= 1);
|
||||||
|
print(j += 1);
|
||||||
|
print(--j);
|
||||||
|
print(++j);
|
||||||
|
|
||||||
|
|
25
unittests/operators_int.txt
Normal file
25
unittests/operators_int.txt
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
3
|
||||||
|
1
|
||||||
|
-1
|
||||||
|
-1
|
||||||
|
2
|
||||||
|
-3
|
||||||
|
1
|
||||||
|
3
|
||||||
|
2
|
||||||
|
4
|
||||||
|
6
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
||||||
|
1
|
||||||
|
3
|
||||||
|
-1
|
||||||
|
6
|
||||||
|
12
|
||||||
|
6
|
||||||
|
2
|
||||||
|
1
|
||||||
|
2
|
||||||
|
1
|
||||||
|
2
|
Loading…
x
Reference in New Issue
Block a user