Updated comparisons test to always print true

This commit is contained in:
Mattia Giambirtone 2022-12-06 11:13:13 +01:00
parent 70cfb0d89c
commit 405c47cd56
1 changed files with 121 additions and 120 deletions

View File

@ -1,152 +1,153 @@
# Tests that comparisons work
import std;
# All these tests should print true
# int64
print(3 > 2); # true
print(2 < 3); # true
print(3 < 2); # false
print(2 > 3); # false
print(2 != 3); # true
print(3 != 2); # true
print(3 == 2); # false
print(2 == 3); # false
print(2 <= 3); # true
print(3 >= 2); # true
print(2 >= 3); # false
print(3 <= 2); # false
print(3 > 2);
print(2 < 3);
print(not (3 < 2));
print(not (2 > 3));
print(2 != 3);
print(3 != 2);
print(not (3 == 2));
print(not (2 == 3));
print(2 <= 3);
print(3 >= 2);
print(not (2 >= 3));
print(not (3 <= 2));
# uint64
var x = 3'u64;
var y = 2'u64;
print(x > y); # true
print(y < x); # true
print(x < y); # false
print(y > x); # false
print(y != x); # true
print(x != y); # true
print(x == y); # false
print(y == x); # false
print(y <= x); # true
print(x >= y); # true
print(y >= x); # false
print(x <= y); # false
print(x > y);
print(y < x);
print(not (x < y));
print(not (y > x));
print(y != x);
print(x != y);
print(not (x == y));
print(not (y == x));
print(y <= x);
print(x >= y);
print(not (y >= x));
print(not (x <= y));
# int32
var x1 = 3'i32;
var y1 = 2'i32;
print(x1 > y1); # true
print(y1 < x1); # true
print(x1 < y1); # false
print(y1 > x1); # false
print(y1 != x1); # true
print(x1 != y1); # true
print(x1 == y1); # false
print(y1 == x1); # false
print(y1 <= x1); # true
print(x1 >= y1); # true
print(y1 >= x1); # false
print(x1 <= y1); # false
print(x1 > y1);
print(y1 < x1);
print(not (x1 < y1));
print(not (y1 > x1));
print(y1 != x1);
print(x1 != y1);
print(not (x1 == y1));
print(not (y1 == x1));
print(y1 <= x1);
print(x1 >= y1);
print(not (y1 >= x1));
print(not (x1 <= y1));
# uint32
var x2 = 3'u32;
var y2 = 2'u32;
print(x2 > y2); # true
print(y2 < x2); # true
print(x2 < y2); # false
print(y2 > x2); # false
print(y2 != x2); # true
print(x2 != y2); # true
print(x2 == y2); # false
print(y2 == x2); # false
print(y2 <= x2); # true
print(x2 >= y2); # true
print(y2 >= x2); # false
print(x2 <= y2); # false
print(x2 > y2);
print(y2 < x2);
print(not (x2 < y2));
print(not (y2 > x2));
print(y2 != x2);
print(x2 != y2);
print(not (x2 == y2));
print(not (y2 == x2));
print(y2 <= x2);
print(x2 >= y2);
print(not (y2 >= x2));
print(not (x2 <= y2));
# int16
var x3 = 3'i16;
var y3 = 2'i16;
print(x3 > y3); # true
print(y3 < x3); # true
print(x3 < y3); # false
print(y3 > x3); # false
print(y3 != x3); # true
print(x3 != y3); # true
print(x3 == y3); # false
print(y3 == x3); # false
print(y3 <= x3); # true
print(x3 >= y3); # true
print(y3 >= x3); # false
print(x3 <= y3); # false
print(x3 > y3);
print(y3 < x3);
print(not (x3 < y3));
print(not (y3 > x3));
print(y3 != x3);
print(x3 != y3);
print(not (x3 == y3));
print(not (y3 == x3));
print(y3 <= x3);
print(x3 >= y3);
print(not (y3 >= x3));
print(not (x3 <= y3));
# uint16
var x4 = 3'u16;
var y4 = 2'u16;
print(x4 > y4); # true
print(y4 < x4); # true
print(x4 < y4); # false
print(y4 > x4); # false
print(y4 != x4); # true
print(x4 != y4); # true
print(x4 == y4); # false
print(y4 == x4); # false
print(y4 <= x4); # true
print(x4 >= y4); # true
print(y4 >= x4); # false
print(x4 <= y4); # false
print(x4 > y4);
print(y4 < x4);
print(not (x4 < y4));
print(not (y4 > x4));
print(y4 != x4);
print(x4 != y4);
print(not (x4 == y4));
print(not (y4 == x4));
print(y4 <= x4);
print(x4 >= y4);
print(not (y4 >= x4));
print(not (x4 <= y4));
# int8
var x5 = 3'i8;
var y5 = 2'i8;
print(x5 > y5); # true
print(y5 < x5); # true
print(x5 < y5); # false
print(y5 > x5); # false
print(y5 != x5); # true
print(x5 != y5); # true
print(x5 == y5); # false
print(y5 == x5); # false
print(y5 <= x5); # true
print(x5 >= y5); # true
print(y5 >= x5); # false
print(x5 <= y5); # false
print(x5 > y5);
print(y5 < x5);
print(not (x5 < y5));
print(not (y5 > x5));
print(y5 != x5);
print(x5 != y5);
print(not (x5 == y5));
print(not (y5 == x5));
print(y5 <= x5);
print(x5 >= y5);
print(not (y5 >= x5));
print(not (x5 <= y5));
# uint8
var x6 = 3'u8;
var y6 = 2'u8;
print(x6 > y6); # true
print(y6 < x6); # true
print(x6 < y6); # false
print(y6 > x6); # false
print(y6 != x6); # true
print(x6 != y6); # true
print(x6 == y6); # false
print(y6 == x6); # false
print(y6 <= x6); # true
print(x6 >= y6); # true
print(y6 >= x6); # false
print(x6 <= y6); # false
print(x6 > y6);
print(y6 < x6);
print(not (x6 < y6));
print(not (y6 > x6));
print(y6 != x6);
print(x6 != y6);
print(not (x6 == y6));
print(not (y6 == x6));
print(y6 <= x6);
print(x6 >= y6);
print(not (y6 >= x6));
print(not (x6 <= y6));
# float64
var x7 = 3.0;
var y7 = 2.0;
print(x7 > y7); # true
print(y7 < x7); # true
print(x7 < y7); # false
print(y7 > x7); # false
print(y7 != x7); # true
print(x7 != y7); # true
print(x7 == y7); # false
print(y7 == x7); # false
print(y7 <= x7); # true
print(x7 >= y7); # true
print(y7 >= x7); # false
print(x7 <= y7); # false
print(x7 > y7);
print(y7 < x7);
print(not (x7 < y7));
print(not (y7 > x7));
print(y7 != x7);
print(x7 != y7);
print(not (x7 == y7));
print(not (y7 == x7));
print(y7 <= x7);
print(x7 >= y7);
print(not (y7 >= x7));
print(not (x7 <= y7));
# float32
var x8 = 3'f32;
var y8 = 2'f32;
print(x8 > y8); # true
print(y8 < x8); # true
print(x8 < y8); # false
print(y8 > x8); # false
print(y8 != x8); # true
print(x8 != y8); # true
print(x8 == y8); # false
print(y8 == x8); # false
print(y8 <= x8); # true
print(x8 >= y8); # true
print(y8 >= x8); # false
print(x8 <= y8); # false
print(x8 > y8);
print(y8 < x8);
print(not (x8 < y8));
print(not (y8 > x8));
print(y8 != x8);
print(x8 != y8);
print(not (x8 == y8));
print(not (y8 == x8));
print(y8 <= x8);
print(x8 >= y8);
print(not (y8 >= x8));
print(not (x8 <= y8));