aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/s-expressions/suites/InMem/BitCore.yqls
blob: e47215ae959354884a33d86d64c37f7fd9e0c6f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
(
(let config (DataSource 'config))
(let world (Configure! world config 'PureDataSource 'yt))

(import core_module '"/lib/yql/core.yqls")
(let res_sink (DataSink 'result))
(let test (lambda '(world data) (block '(
  (let world (Write! world res_sink (Key) data '('('type))))
  (return world)
))))

(let world (Apply test world (Apply (bind core_module 'TestBit) (String '"\x05\x04") (Uint64 '0))))
(let world (Apply test world (Apply (bind core_module 'TestBit) (String '"\x05\x04") (Uint64 '10))))
(let world (Apply test world (Apply (bind core_module 'TestBit) (String '"\x05\x04") (Uint64 '11))))
(let world (Apply test world (Apply (bind core_module 'TestBit) (String '"\x05\x04") (Uint64 '23))))
(let world (Apply test world (Apply (bind core_module 'TestBit) (Just (String '"\x05\x04")) (Uint64 '0))))
(let world (Apply test world (Apply (bind core_module 'TestBit) (Just (Utf8 '"\x05\x04")) (Uint64 '0))))
(let world (Apply test world (Apply (bind core_module 'TestBit) (Uint8 '5) (Uint8 '0))))
(let world (Apply test world (Apply (bind core_module 'TestBit) (Uint32 '5) (Uint8 '2))))
(let world (Apply test world (Apply (bind core_module 'TestBit) (Uint64 '5) (Uint8 '1))))
(let world (Apply test world (Apply (bind core_module 'TestBit) (Just (Uint8 '5)) (Uint8 '0))))
(let world (Apply test world (Apply (bind core_module 'SetBit) (Uint32 '5) (Uint8 '1))))
(let world (Apply test world (Apply (bind core_module 'SetBit) (Just (Uint32 '5)) (Uint8 '1))))
(let world (Apply test world (Apply (bind core_module 'ClearBit) (Uint32 '5) (Uint8 '0))))
(let world (Apply test world (Apply (bind core_module 'ClearBit) (Just (Uint32 '5)) (Uint8 '0))))
(let world (Apply test world (Apply (bind core_module 'FlipBit) (Uint32 '5) (Uint8 '0))))
(let world (Apply test world (Apply (bind core_module 'FlipBit) (Just (Uint32 '5)) (Uint8 '0))))
(let world (Commit! world res_sink))
(return world)
)