Handle error cases for bit-shift operators more cleanly

This commit is contained in:
Tim Wojtulewicz 2022-07-21 13:03:16 -07:00
parent ac4b7f9f02
commit 8fff3c76b9
3 changed files with 41 additions and 4 deletions

View file

@ -18,6 +18,7 @@ modulus operator (PASS)
division operator (PASS)
assignment operator (PASS)
assignment operator (PASS)
bitwise lshift (PASS)
bitwise rshift (PASS)
max int value = 9223372036854775807 (PASS)
min int value = -9223372036854775808 (PASS)

View file

@ -54,7 +54,8 @@ event zeek_init()
test_case( "assignment operator", i2 == 7 );
i2 -= 2;
test_case( "assignment operator", i2 == 5 );
test_case( "bitwise rshift", i10 >> 1 == -6 );
test_case( "bitwise lshift", i6 << 1 == 24 );
test_case( "bitwise rshift", i6 >> 1 == 6 );
# Max/min value tests
@ -68,4 +69,3 @@ event zeek_init()
test_case( str4, str4 == "min int value = -9223372036854775808" );
}