aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/s-expressions/suites/InMem/QueueSimpleStrings.yql
blob: e7c8c1d0297b3ef5647955cf270264f8eb004736 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
(
(let config (DataSource 'config))
(let world (Configure! world config 'PureDataSource 'yt))

(let res_sink (DataSink 'result))

(let qr (QueueCreate (OptionalType (DataType 'String)) (Uint64 '5) (Uint64 '0)))
(let qr (QueuePush qr (String '"It")))
(let qr (QueuePush qr (Just (String '"is"))))
(let qr (QueuePush qr (String '"funny")))
(let qr (QueuePop qr))
(let qr (QueuePush qr (Just (String '"bunny"))))
(let qr (QueuePop qr))
(let result '((QueuePeek qr (Minus (Uint64 '1))) (QueuePeek qr (Uint64 '0)) (QueuePeek qr (Uint64 '1)) (QueuePeek qr (Uint64 '2))))

(let world (Write! world res_sink (Key) result '('('type))))
(let world (Commit! world res_sink))
(return world)
)