more tests

This commit is contained in:
0rphon 2022-06-16 12:53:53 -07:00
parent b656fd5347
commit 1cc47e9d08
49 changed files with 512 additions and 253 deletions

View File

@ -4,13 +4,20 @@ expectation: Pass
*/
1u8 + 1u8
2u8+3u8
1u8 + 2u8 + 3u8
1u8 * 2u8 + 3u8 * 4u8
1u8 + 2u8 - 3u8
1u8 * 2u8 + 3u8 * 4u8 - 5u8 * 6u8
1u8 * 2u8 + 3u8 * 4u8 - 5u8 * 6u8
!-x.add(y)
x.add(y).add(y).add(y)
-x.add(y)
(-x).add(y)
-(x.add(y))
(-x.add(y)).add(y)
!x.add(y)
(!x).add(y)
!(x.add(y))
(!x.add(y)).add(y)
(x.add(y) + x.add(y)).add(x.add(y) + x.add(y))

View File

@ -0,0 +1,16 @@
/*
namespace: ParseExpression
expectation: Pass
*/
!-x.add_wrapped(y)
x.add_wrapped(y).add_wrapped(y).add_wrapped(y)
-x.add_wrapped(y)
(-x).add_wrapped(y)
-(x.add_wrapped(y))
(-x.add_wrapped(y)).add_wrapped(y)
!x.add_wrapped(y)
(!x).add_wrapped(y)
!(x.add_wrapped(y))
(!x.add_wrapped(y)).add_wrapped(y)
(x.add_wrapped(y) + x.add_wrapped(y)).add_wrapped(x.add_wrapped(y) + x.add_wrapped(y))

View File

@ -7,4 +7,16 @@ true && false
false&&true
true&&false&&true
true&&false&&true
!-x.and(y)
x.and(y).and(y).and(y)
-x.and(y)
(-x).and(y)
-(x.and(y))
(-x.and(y)).and(y)
!x.and(y)
(!x).and(y)
!(x.and(y))
(!x.and(y)).and(y)
(x.and(y) + x.and(y)).and(x.and(y) + x.and(y))

View File

@ -0,0 +1,28 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1 & 1
2&3
1 & 2 & 3
1 == 2 & 3 == 4
1 & 2 & 3
1 == 2 & 3 == 4 & 5 == 6
!-x.and(y)
x.and(y).and(y).and(y)
-x.and(y)
(-x).and(y)
-(x.and(y))
(-x.and(y)).and(y)
!x.and(y)
(!x).and(y)
!(x.and(y))
(!x.and(y)).and(y)
(x.and(y) & x.and(y)).and(x.and(y) & x.and(y))

View File

@ -0,0 +1,28 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1 & 1
2&3
1 & 2 & 3
1 == 2 & 3 == 4
1 & 2 & 3
1 == 2 & 3 == 4 & 5 == 6
!-x.and(y)
x.and(y).and(y).and(y)
-x.and(y)
(-x).and(y)
-(x.and(y))
(-x.and(y)).and(y)
!x.and(y)
(!x).and(y)
!(x.and(y))
(!x.and(y)).and(y)
(x.and(y) & x.and(y)).and(x.and(y) & x.and(y))

View File

@ -1,16 +0,0 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1 & 1
2&3
1 & 2 & 3
1 == 2 & 3 == 4
1 & 2 & 3
1 == 2 & 3 == 4 & 5 == 6

View File

@ -0,0 +1,28 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1 | 1
2|3
1 | 2 | 3
1 ^ 2 | 3 ^ 4
1 | 2 | 3
1 ^ 2 | 3 ^ 4 | 5 ^ 6
!-x.or(y)
x.or(y).or(y).or(y)
-x.or(y)
(-x).or(y)
-(x.or(y))
(-x.or(y)).or(y)
!x.or(y)
(!x).or(y)
!(x.or(y))
(!x.or(y)).or(y)
(x.or(y) | x.or(y)).or(x.or(y) | x.or(y))

View File

@ -1,16 +0,0 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1 | 1
2|3
1 | 2 | 3
1 ^ 2 | 3 ^ 4
1 | 2 | 3
1 ^ 2 | 3 ^ 4 | 5 ^ 6

View File

@ -0,0 +1,28 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1 ^ 1
2^3
1 ^ 2 ^ 3
1 & 2 ^ 3 & 4
1 ^ 2 ^ 3
1 & 2 ^ 3 & 4 ^ 5 & 6
!-x.xor(y)
x.xor(y).xor(y).xor(y)
-x.xor(y)
(-x).xor(y)
-(x.xor(y))
(-x.xor(y)).xor(y)
!x.xor(y)
(!x).xor(y)
!(x.xor(y))
(!x.xor(y)).xor(y)
(x.xor(y) ^ x.xor(y)).xor(x.xor(y) ^ x.xor(y))

View File

@ -1,16 +0,0 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1 ^ 1
2^3
1 ^ 2 ^ 3
1 & 2 ^ 3 & 4
1 ^ 2 ^ 3
1 & 2 ^ 3 & 4 ^ 5 & 6

View File

@ -9,4 +9,16 @@ expectation: Pass
1u8 / 2u8 / 3u8
1u8 ** 2u8 / 3u8 ** 4u8
1u8 ** 2u8 / 3u8 ** 4u8
!-x.div(y)
x.div(y).div(y).div(y)
-x.div(y)
(-x).div(y)
-(x.div(y))
(-x.div(y)).div(y)
!x.div(y)
(!x).div(y)
!(x.div(y))
(!x.div(y)).div(y)
(x.div(y) / x.div(y)).div(x.div(y) / x.div(y))

View File

@ -0,0 +1,16 @@
/*
namespace: ParseExpression
expectation: Pass
*/
!-x.div(y)
x.div(y).div(y).div(y)
-x.div(y)
(-x).div(y)
-(x.div(y))
(-x.div(y)).div(y)
!x.div(y)
(!x).div(y)
!(x.div(y))
(!x.div(y)).div(y)
(x.div(y) / x.div(y)).div(x.div(y) / x.div(y))

View File

@ -9,4 +9,16 @@ expectation: Pass
1u8 < 2u8 == 3u8 < 4u8
1u8 < 2u8 == 3u8 < 4u8 && 3u8 < 4u8 == 5u8 < 6u8
1u8 < 2u8 == 3u8 < 4u8 && 3u8 < 4u8 == 5u8 < 6u8
!-x.eq(y)
x.eq(y).eq(y).eq(y)
-x.eq(y)
(-x).eq(y)
-(x.eq(y))
(-x.eq(y)).eq(y)
!x.eq(y)
(!x).eq(y)
!(x.eq(y))
(!x.eq(y)).eq(y)
(x.eq(y) == x.eq(y)).eq(x.eq(y) == x.eq(y))

View File

@ -1,11 +0,0 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1u8 ** 1u8
2u8**3u8
1u8 ** 2u8 ** 3u8

View File

@ -0,0 +1,22 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1u8 >= 1u8
2u8 >= 3u8
1u8 + 2u8 >= 3u8 + 4u8
!-x.ge(y)
x.ge(y).ge(y).ge(y)
-x.ge(y)
(-x).ge(y)
-(x.ge(y))
(-x.ge(y)).ge(y)
!x.ge(y)
(!x).ge(y)
!(x.ge(y))
(!x.ge(y)).ge(y)
(x.ge(y) >= x.ge(y)).ge(x.ge(y) >= x.ge(y))

View File

@ -7,4 +7,16 @@ expectation: Pass
2u8>3u8
1u8 + 2u8 > 3u8 + 4u8
1u8 + 2u8 > 3u8 + 4u8
!-x.gt(y)
x.gt(y).gt(y).gt(y)
-x.gt(y)
(-x).gt(y)
-(x.gt(y))
(-x.gt(y)).gt(y)
!x.gt(y)
(!x).gt(y)
!(x.gt(y))
(!x.gt(y)).gt(y)
(x.gt(y) > x.gt(y)).gt(x.gt(y) > x.gt(y))

View File

@ -1,16 +0,0 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1 > 1
2>3
1 > 2 > 3
1 >> 2 > 3 >> 4
1 > 2 > 3
1 >> 2 > 3 >> 4 > 5 >> 6

View File

@ -1,10 +0,0 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1u8 >= 1u8
2u8 >= 3u8
1u8 + 2u8 >= 3u8 + 4u8

View File

@ -1,16 +0,0 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1 >= 1
2 >= 3
1 >= 2 >= 3
1 >> 2 >= 3 >> 4
1 >= 2 >= 3
1 >> 2 >= 3 >> 4 >= 5 >> 6

View File

@ -0,0 +1,22 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1u8 <= 1u8
2u8 <= 3u8
1u8 + 2u8 <= 3u8 + 4u8
!-x.le(y)
x.le(y).le(y).le(y)
-x.le(y)
(-x).le(y)
-(x.le(y))
(-x.le(y)).le(y)
!x.le(y)
(!x).le(y)
!(x.le(y))
(!x.le(y)).le(y)
(x.le(y) <= x.le(y)).le(x.le(y) <= x.le(y))

View File

@ -7,4 +7,16 @@ expectation: Pass
2u8<3u8
1u8 + 2u8 < 3u8 + 4u8
1u8 + 2u8 < 3u8 + 4u8
!-x.lt(y)
x.lt(y).lt(y).lt(y)
-x.lt(y)
(-x).lt(y)
-(x.lt(y))
(-x.lt(y)).lt(y)
!x.lt(y)
(!x).lt(y)
!(x.lt(y))
(!x.lt(y)).lt(y)
(x.lt(y) < x.lt(y)).lt(x.lt(y) < x.lt(y))

View File

@ -1,16 +0,0 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1 < 1
2<3
1 < 2 < 3
1 << 2 < 3 << 4
1 < 2 < 3
1 << 2 < 3 << 4 < 5 << 6

View File

@ -1,10 +0,0 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1u8 <= 1u8
2u8 <= 3u8
1u8 + 2u8 <= 3u8 + 4u8

View File

@ -1,16 +0,0 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1 <= 1
2 <= 3
1 <= 2 <= 3
1 << 2 <= 3 << 4
1 <= 2 <= 3
1 << 2 <= 3 << 4 <= 5 << 6

View File

@ -1,14 +0,0 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1 % 1
2%3
1 % 2 % 3
1 ** 2 % 3 ** 4
1 ** 2 % 3 ** 4 % 5 ** 6

View File

@ -11,4 +11,16 @@ expectation: Pass
1u8 ** 2u8 * 3u8 ** 4u8
1u8 ** 2u8 * 3u8 ** 4u8 / 5u8 ** 6u8
1u8 ** 2u8 * 3u8 ** 4u8 / 5u8 ** 6u8
!-x.mul(y)
x.mul(y).mul(y).mul(y)
-x.mul(y)
(-x).mul(y)
-(x.mul(y))
(-x.mul(y)).mul(y)
!x.mul(y)
(!x).mul(y)
!(x.mul(y))
(!x.mul(y)).mul(y)
(x.mul(y) * x.mul(y)).mul(x.mul(y) * x.mul(y))

View File

@ -0,0 +1,16 @@
/*
namespace: ParseExpression
expectation: Pass
*/
!-x.mul_wrapped(y)
x.mul_wrapped(y).mul_wrapped(y).mul_wrapped(y)
-x.mul_wrapped(y)
(-x).mul_wrapped(y)
-(x.mul_wrapped(y))
(-x.mul_wrapped(y)).mul_wrapped(y)
!x.mul_wrapped(y)
(!x).mul_wrapped(y)
!(x.mul_wrapped(y))
(!x.mul_wrapped(y)).mul_wrapped(y)
(x.mul_wrapped(y) * x.mul_wrapped(y)).mul_wrapped(x.mul_wrapped(y) * x.mul_wrapped(y))

View File

@ -0,0 +1,16 @@
/*
namespace: ParseExpression
expectation: Pass
*/
!-x.nand(y)
x.nand(y).nand(y).nand(y)
-x.nand(y)
(-x).nand(y)
-(x.nand(y))
(-x.nand(y)).nand(y)
!x.nand(y)
(!x).nand(y)
!(x.nand(y))
(!x.nand(y)).nand(y)
(x.nand(y) & x.nand(y)).nand(x.nand(y) & x.nand(y))

View File

@ -1,12 +0,0 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1u8 != 1u8
2u8!=3u8
1u8 < 2u8 != 3u8 < 4u8
1u8 < 2u8 != 3u8 < 4u8 || 3u8 < 4u8 != 5u8 < 6u8

View File

@ -0,0 +1,24 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1u8 != 1u8
2u8!=3u8
1u8 < 2u8 != 3u8 < 4u8
1u8 < 2u8 != 3u8 < 4u8 || 3u8 < 4u8 != 5u8 < 6u8
!-x.neq(y)
x.neq(y).neq(y).neq(y)
-x.neq(y)
(-x).neq(y)
-(x.neq(y))
(-x.neq(y)).neq(y)
!x.neq(y)
(!x).neq(y)
!(x.neq(y))
(!x.neq(y)).neq(y)
(x.neq(y) != x.neq(y)).neq(x.neq(y) != x.neq(y))

View File

@ -0,0 +1,16 @@
/*
namespace: ParseExpression
expectation: Pass
*/
!-x.nor(y)
x.nor(y).nor(y).nor(y)
-x.nor(y)
(-x).nor(y)
-(x.nor(y))
(-x.nor(y)).nor(y)
!x.nor(y)
(!x).nor(y)
!(x.nor(y))
(!x.nor(y)).nor(y)
(x.nor(y) != x.nor(y)).nor(x.nor(y) != x.nor(y))

View File

@ -3,14 +3,12 @@ namespace: ParseExpression
expectation: Pass
*/
1u8 + 1u8
true || true
2u8+3u16
false||true
1u8 + 2u8 + 3u8
true||false || false
1u8 * 2u8 + 3u8 * 4u8
true || false || true || false
1i8 + 2i8 - 3i8
1u8 * 2u8 + 3u8 * 4u8 - 5u8 * 6u8
true || (true || false) || true

View File

@ -0,0 +1,22 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1u8 ** 1u8
2u8**3u8
1u8 ** 2u8 ** 3u8
!-x.pow(y)
x.pow(y).pow(y).pow(y)
-x.pow(y)
(-x).pow(y)
-(x.pow(y))
(-x.pow(y)).pow(y)
!x.pow(y)
(!x).pow(y)
!(x.pow(y))
(!x.pow(y)).pow(y)
(x.pow(y) ** x.pow(y)).pow(x.pow(y) ** x.pow(y))

View File

@ -0,0 +1,16 @@
/*
namespace: ParseExpression
expectation: Pass
*/
!-x.pow_wrapped(y)
x.pow_wrapped(y).pow_wrapped(y).pow_wrapped(y)
-x.pow_wrapped(y)
(-x).pow_wrapped(y)
-(x.pow_wrapped(y))
(-x.pow_wrapped(y)).pow_wrapped(y)
!x.pow_wrapped(y)
(!x).pow_wrapped(y)
!(x.pow_wrapped(y))
(!x.pow_wrapped(y)).pow_wrapped(y)
(x.pow_wrapped(y) ** x.pow_wrapped(y)).pow_wrapped(x.pow_wrapped(y) ** x.pow_wrapped(y))

View File

@ -0,0 +1,28 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1 << 1
2<<3
1 << 2 << 3
1 + 2 << 3 + 4
1 << 2 << 3
1 + 2 << 3 + 4 << 5 + 6
!-x.shl(y)
x.shl(y).shl(y).shl(y)
-x.shl(y)
(-x).shl(y)
-(x.shl(y))
(-x.shl(y)).shl(y)
!x.shl(y)
(!x).shl(y)
!(x.shl(y))
(!x.shl(y)).shl(y)
(x.shl(y) << x.shl(y)).shl(x.shl(y) << x.shl(y))

View File

@ -1,16 +0,0 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1 << 1
2<<3
1 << 2 << 3
1 + 2 << 3 + 4
1 << 2 << 3
1 + 2 << 3 + 4 << 5 + 6

View File

@ -0,0 +1,16 @@
/*
namespace: ParseExpression
expectation: Pass
*/
!-x.shl_wrapped(y)
x.shl_wrapped(y).shl_wrapped(y).shl_wrapped(y)
-x.shl_wrapped(y)
(-x).shl_wrapped(y)
-(x.shl_wrapped(y))
(-x.shl_wrapped(y)).shl_wrapped(y)
!x.shl_wrapped(y)
(!x).shl_wrapped(y)
!(x.shl_wrapped(y))
(!x.shl_wrapped(y)).shl_wrapped(y)
(x.shl_wrapped(y) << x.shl_wrapped(y)).shl_wrapped(x.shl_wrapped(y) << x.shl_wrapped(y))

View File

@ -0,0 +1,28 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1 >> 1
2>>3
1 >> 2 >> 3
1 + 2 >> 3 + 4
1 >> 2 >> 3
1 + 2 >> 3 + 4 >> 5 + 6
!-x.shr(y)
x.shr(y).shr(y).shr(y)
-x.shr(y)
(-x).shr(y)
-(x.shr(y))
(-x.shr(y)).shr(y)
!x.shr(y)
(!x).shr(y)
!(x.shr(y))
(!x.shr(y)).shr(y)
(x.shr(y) >> x.shr(y)).shr(x.shr(y) >> x.shr(y))

View File

@ -1,16 +0,0 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1 >> 1
2>>3
1 >> 2 >> 3
1 + 2 >> 3 + 4
1 >> 2 >> 3
1 + 2 >> 3 + 4 >> 5 + 6

View File

@ -1,16 +0,0 @@
/*
namespace: ParseExpression
expectation: Pass
*/
1 >>> 1
2>>>3
1 >>> 2 >>> 3
1 + 2 >>> 3 + 4
1 >>> 2 >>> 3
1 + 2 >>> 3 + 4 >>> 5 + 6

View File

@ -0,0 +1,16 @@
/*
namespace: ParseExpression
expectation: Pass
*/
!-x.shr_wrapped(y)
x.shr_wrapped(y).shr_wrapped(y).shr_wrapped(y)
-x.shr_wrapped(y)
(-x).shr_wrapped(y)
-(x.shr_wrapped(y))
(-x.shr_wrapped(y)).shr_wrapped(y)
!x.shr_wrapped(y)
(!x).shr_wrapped(y)
!(x.shr_wrapped(y))
(!x.shr_wrapped(y)).shr_wrapped(y)
(x.shr_wrapped(y) >> x.shr_wrapped(y)).shr_wrapped(x.shr_wrapped(y) >> x.shr_wrapped(y))

View File

@ -9,4 +9,16 @@ expectation: Pass
1u32 - 2u32 - 3u32
1u8 * 2u16 - 3u32 * 4i64
1u8 * 2u16 - 3u32 * 4i64
!-x.sub(y)
x.sub(y).sub(y).sub(y)
-x.sub(y)
(-x).sub(y)
-(x.sub(y))
(-x.sub(y)).sub(y)
!x.sub(y)
(!x).sub(y)
!(x.sub(y))
(!x.sub(y)).sub(y)
(x.sub(y) << x.sub(y)).sub(x.sub(y) << x.sub(y))

View File

@ -0,0 +1,16 @@
/*
namespace: ParseExpression
expectation: Pass
*/
!-x.sub_wrapped(y)
x.sub_wrapped(y).sub_wrapped(y).sub_wrapped(y)
-x.sub_wrapped(y)
(-x).sub_wrapped(y)
-(x.sub_wrapped(y))
(-x.sub_wrapped(y)).sub_wrapped(y)
!x.sub_wrapped(y)
(!x).sub_wrapped(y)
!(x.sub_wrapped(y))
(!x.sub_wrapped(y)).sub_wrapped(y)
(x.sub_wrapped(y) << x.sub_wrapped(y)).sub_wrapped(x.sub_wrapped(y) << x.sub_wrapped(y))

View File

@ -8,7 +8,7 @@ expectation: Pass
!!x
!-xx.not()
!-x.not()
x.not().not().not()
-x.not()
(-x).not()

View File

@ -1,15 +0,0 @@
/*
namespace: ParseExpression
expectation: Pass
*/
!-xx.sqrt()
x.sqrt().sqrt().sqrt()
-x.sqrt()
(-x).sqrt()
-(x.sqrt())
(-x.sqrt()).sqrt()
!x.sqrt()
(!x).sqrt()
!(x.sqrt())
(!x.sqrt()).sqrt()

View File

@ -3,7 +3,7 @@ namespace: ParseExpression
expectation: Pass
*/
!-xx.square()
!-x.square()
x.square().square().square()
-x.square()
(-x).square()