aboutsummaryrefslogtreecommitdiff
path: root/server/test/Thermoprint/Server/QueueSpec.hs
blob: 8a6bb7b0c2b87c405dd40f1ae1f177576658aeae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, StandaloneDeriving #-}

module Thermoprint.Server.QueueSpec (spec) where

import Test.Hspec
import Test.Hspec.QuickCheck (prop)

import Thermoprint.Server.Queue
import Thermoprint.Server.Database
import Thermoprint.API hiding (JobId)

import Test.QuickCheck.Arbitrary
import Test.QuickCheck.Gen
import Test.QuickCheck.Modifiers

deriving instance (Eq PrintingError)
deriving instance (Eq Queue)

spec :: Spec
spec = do
  describe "queue morphisms" $ do
    prop "are inverse" $ \queue -> queue == toZipper (fromZipper queue)