1
1
mirror of https://github.com/wader/fq.git synced 2024-12-26 15:02:28 +03:00
fq/pkg/interp/testdata/bitops.fqtest
Mattias Wadman e238f292af repl: Speedup multi input to sub-repl
Rewrite non-sub-repl queries as "q" -> ".[] | q" and pass in inputs as array.
Before each input did an eval.

Also fixup error message a bit, skip line:column when they dont make sense.
2022-02-18 01:13:45 +01:00

52 lines
1.4 KiB
Plaintext

$ fq -i
null> 0, -1, 1208925819614629174706175, -1208925819614629174706176 | bnot
-1
0
-1208925819614629174706176
1208925819614629174706175
null> null | bnot
error: cannot bnot: null
null> bnot(1)
error: expr: function not defined: bnot/1
null> [0,0], [8,1], [0xffff_ffff_ffff_ffff,1] | bsl(.[0]; .[1])
0
16
36893488147419103230
null> bsl(1)
error: expr: function not defined: bsl/1
null> bsl(null; 1)
error: cannot bsl: null and number
null> [0,0], [8,1], [0x1_ffff_ffff_ffff_fffe,1] | bsr(.[0]; .[1])
0
4
18446744073709551615
null> bsr(1)
error: expr: function not defined: bsr/1
null> bsr(null; 1)
error: cannot bsr: null and number
null> [0,0], [0xffff_ffff_ffff_ffff_ffff,0x1234], [0x1234,0xffff_ffff_ffff_ffff_ffff,0x1234] | band(.[0]; .[1])
0
4660
4660
null> band(1)
error: expr: function not defined: band/1
null> band(null; 1)
error: cannot band: null and number
null> [0,0], [0xffff_ffff_ffff_ffff_0000,0x1234], [0x1234,0xffff_ffff_ffff_ffff_0000,0x1234] | bor(.[0]; .[1])
0
1208925819614629174645300
1208925819614629174645300
null> bor(1)
error: expr: function not defined: bor/1
null> bor(null; 1)
error: cannot bor: null and number
null> [0,0], [0xffff_ffff_ffff_ffff_ffff,0x1234], [0x1234,0xffff_ffff_ffff_ffff_ffff,0x1234] | bxor(.[0]; .[1])
0
1208925819614629174701515
1208925819614629174701515
null> bxor(1)
error: expr: function not defined: bxor/1
null> bxor(null; 1)
error: cannot bxor: null and number
null> ^D