mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-19 18:01:31 +00:00
More tests and fixes (unary, binary, globals)
This commit is contained in:
88
tests/compiler/unary.ts
Normal file
88
tests/compiler/unary.ts
Normal file
@ -0,0 +1,88 @@
|
||||
+1;
|
||||
-1;
|
||||
!1;
|
||||
~1;
|
||||
+1.25;
|
||||
-1.25;
|
||||
!1.25;
|
||||
// ~1.25;
|
||||
|
||||
let i: i32 = 0;
|
||||
|
||||
+i;
|
||||
-i;
|
||||
!i;
|
||||
~i;
|
||||
++i;
|
||||
--i;
|
||||
|
||||
i = +1;
|
||||
i = -1;
|
||||
i = !1;
|
||||
i = ~1;
|
||||
i = +i;
|
||||
i = -i;
|
||||
i = !i;
|
||||
i = ~i;
|
||||
i = ++i;
|
||||
i = --i;
|
||||
|
||||
let I: i64 = 0;
|
||||
|
||||
+I;
|
||||
-I;
|
||||
!I;
|
||||
~I;
|
||||
++I;
|
||||
--I;
|
||||
|
||||
I = +1;
|
||||
I = -1;
|
||||
I = !1;
|
||||
I = ~1;
|
||||
I = +I;
|
||||
I = -I;
|
||||
I = !I;
|
||||
I = ~I;
|
||||
I = ++I;
|
||||
I = --I;
|
||||
|
||||
let f: f32 = 0;
|
||||
|
||||
+f;
|
||||
-f;
|
||||
!f;
|
||||
// ~f;
|
||||
++f;
|
||||
--f;
|
||||
|
||||
f = +1.25;
|
||||
f = -1.25;
|
||||
i = !1.25;
|
||||
// i = ~1.25;
|
||||
f = +f;
|
||||
f = -f;
|
||||
i = !f;
|
||||
// i = ~f;
|
||||
f = ++f;
|
||||
f = --f;
|
||||
|
||||
let F: f64 = 0;
|
||||
|
||||
+F;
|
||||
-F;
|
||||
!F;
|
||||
// ~F;
|
||||
++F;
|
||||
--F;
|
||||
|
||||
F = +1.25;
|
||||
F = -1.25;
|
||||
I = !1.25;
|
||||
// I = ~1.25;
|
||||
F = +F;
|
||||
F = -F;
|
||||
I = !F;
|
||||
// I = ~F;
|
||||
F = ++F;
|
||||
F = --F;
|
Reference in New Issue
Block a user