[test](xor) add test for xor #33731

This commit is contained in:
zhiqiang
2024-04-17 10:49:56 +08:00
committed by yiguolei
parent 89c4fa5a75
commit bb33375dba
2 changed files with 26 additions and 0 deletions

View File

@ -134,3 +134,20 @@
-- !select --
1 1
-- !bitxor --
125 -127
-- !bitxor --
0 127 0 127
1 126 -1 -128
2 125 -2 -127
3 124 -3 -126
4 123 -4 -125
-- !bitxor --
0 0 0 0
1 0 -1 0
2 0 -2 0
3 0 -3 0
4 0 -4 0

View File

@ -81,4 +81,13 @@ suite("test_bit_functions") {
qt_select "select bit_count(bit_shift_right(-1, 63)), bit_count(bit_shift_right(-1, 63));"
qt_bitxor """
select 2^127, -2^127;
"""
qt_bitxor """
select number, number^127, -number, (-number)^127 from numbers("number"="5") order by number;
"""
qt_bitxor """
select number, number^number, -number, (-number)^(-number) from numbers("number"="5") order by number
"""
}