22 lines
550 B
Haskell
Raw Permalink Normal View History

module Main where
import MiniSeqQueues.Queue
( Retry (Retry)
, enqueueRetry
, renderBatch
, renderQueue
, sampleQueue
, takeBatch
)
import System.Exit (die)
main :: IO ()
main =
let queueWithNewRetry = enqueueRetry sampleQueue (Retry "auth" 1)
(nextBatch, remainingQueue) = takeBatch 2 queueWithNewRetry
in if renderBatch nextBatch == "api#2, worker#1"
&& renderQueue remainingQueue == "billing#3, search#1, auth#1" then
putStrLn "test passed"
else
die "unexpected Data.Sequence result"