diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-23 12:46:20 +0000 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-23 12:46:20 +0000 |
commit | 44fed137c50043f87e97996aa32f3353f9a2eeb0 (patch) | |
tree | 84acb8148a46fd30309eec93606dddbfca66cd81 /spec | |
parent | 5273512b68c67eff2c8e869f84dad1c4d69e16a8 (diff) | |
download | thermoprint-44fed137c50043f87e97996aa32f3353f9a2eeb0.tar thermoprint-44fed137c50043f87e97996aa32f3353f9a2eeb0.tar.gz thermoprint-44fed137c50043f87e97996aa32f3353f9a2eeb0.tar.bz2 thermoprint-44fed137c50043f87e97996aa32f3353f9a2eeb0.tar.xz thermoprint-44fed137c50043f87e97996aa32f3353f9a2eeb0.zip |
Removed persistent instances & dep from spec
Diffstat (limited to 'spec')
-rw-r--r-- | spec/src/Thermoprint/Printout.hs | 13 | ||||
-rw-r--r-- | spec/thermoprint-spec.cabal | 1 | ||||
-rw-r--r-- | spec/thermoprint-spec.nix | 7 |
3 files changed, 3 insertions, 18 deletions
diff --git a/spec/src/Thermoprint/Printout.hs b/spec/src/Thermoprint/Printout.hs index aae71aa..2be0a83 100644 --- a/spec/src/Thermoprint/Printout.hs +++ b/spec/src/Thermoprint/Printout.hs | |||
@@ -33,9 +33,6 @@ import Data.Aeson.Types (typeMismatch) | |||
33 | 33 | ||
34 | import Data.Proxy (Proxy(..)) | 34 | import Data.Proxy (Proxy(..)) |
35 | 35 | ||
36 | import Database.Persist.Class (PersistField(..)) | ||
37 | import Database.Persist.Sql (PersistFieldSql(..)) | ||
38 | |||
39 | import Test.QuickCheck.Arbitrary (Arbitrary(..), CoArbitrary, genericShrink) | 36 | import Test.QuickCheck.Arbitrary (Arbitrary(..), CoArbitrary, genericShrink) |
40 | import Test.QuickCheck.Modifiers (NonNegative(..)) | 37 | import Test.QuickCheck.Modifiers (NonNegative(..)) |
41 | import Test.QuickCheck.Gen (oneof, scale) | 38 | import Test.QuickCheck.Gen (oneof, scale) |
@@ -58,9 +55,6 @@ import Data.Function (on) | |||
58 | 55 | ||
59 | import Data.Foldable (toList, fold) | 56 | import Data.Foldable (toList, fold) |
60 | 57 | ||
61 | import Data.Bifunctor | ||
62 | import Control.Monad ((<=<)) | ||
63 | |||
64 | import Data.Encoding (encodeLazyByteStringExplicit, decodeLazyByteString) | 58 | import Data.Encoding (encodeLazyByteStringExplicit, decodeLazyByteString) |
65 | import Data.Encoding.UTF8 | 59 | import Data.Encoding.UTF8 |
66 | import qualified Data.ByteString.Base64.Lazy as Base64 (encode, decode) | 60 | import qualified Data.ByteString.Base64.Lazy as Base64 (encode, decode) |
@@ -71,13 +65,6 @@ import Prelude hiding (fold) | |||
71 | -- | A 'Printout' is a sequence of visually seperated 'Paragraph's | 65 | -- | A 'Printout' is a sequence of visually seperated 'Paragraph's |
72 | type Printout = Seq Paragraph | 66 | type Printout = Seq Paragraph |
73 | 67 | ||
74 | instance PersistField Printout where | ||
75 | toPersistValue = toPersistValue . LBS.toStrict . JSON.encode | ||
76 | fromPersistValue = first T.pack . JSON.eitherDecodeStrict' <=< fromPersistValue | ||
77 | |||
78 | instance PersistFieldSql Printout where | ||
79 | sqlType _ = sqlType (Proxy :: Proxy Strict.ByteString) | ||
80 | |||
81 | -- | A 'Paragraph' is a non-seperated sequence of 'Chunk's | 68 | -- | A 'Paragraph' is a non-seperated sequence of 'Chunk's |
82 | type Paragraph = Seq Chunk | 69 | type Paragraph = Seq Chunk |
83 | 70 | ||
diff --git a/spec/thermoprint-spec.cabal b/spec/thermoprint-spec.cabal index 942cbe4..da79ee8 100644 --- a/spec/thermoprint-spec.cabal +++ b/spec/thermoprint-spec.cabal | |||
@@ -44,7 +44,6 @@ library | |||
44 | , aeson >=0.9.0 && <1 | 44 | , aeson >=0.9.0 && <1 |
45 | , base64-bytestring >=1.0.0 && <2 | 45 | , base64-bytestring >=1.0.0 && <2 |
46 | , encoding >=0.8 && <1 | 46 | , encoding >=0.8 && <1 |
47 | , persistent >=2.2 && <3 | ||
48 | -- hs-source-dirs: | 47 | -- hs-source-dirs: |
49 | default-language: Haskell2010 | 48 | default-language: Haskell2010 |
50 | 49 | ||
diff --git a/spec/thermoprint-spec.nix b/spec/thermoprint-spec.nix index 6d94ef6..1825ddd 100644 --- a/spec/thermoprint-spec.nix +++ b/spec/thermoprint-spec.nix | |||
@@ -1,7 +1,6 @@ | |||
1 | { mkDerivation, aeson, base, base64-bytestring, bytestring, Cabal | 1 | { mkDerivation, aeson, base, base64-bytestring, bytestring, Cabal |
2 | , cabal-test-quickcheck, containers, deepseq, encoding, hspec | 2 | , cabal-test-quickcheck, containers, deepseq, encoding, hspec |
3 | , persistent, QuickCheck, quickcheck-instances, servant, stdenv | 3 | , QuickCheck, quickcheck-instances, servant, stdenv, text |
4 | , text | ||
5 | }: | 4 | }: |
6 | mkDerivation { | 5 | mkDerivation { |
7 | pname = "thermoprint-spec"; | 6 | pname = "thermoprint-spec"; |
@@ -9,8 +8,8 @@ mkDerivation { | |||
9 | src = ./.; | 8 | src = ./.; |
10 | libraryHaskellDepends = [ | 9 | libraryHaskellDepends = [ |
11 | aeson base base64-bytestring bytestring Cabal cabal-test-quickcheck | 10 | aeson base base64-bytestring bytestring Cabal cabal-test-quickcheck |
12 | containers deepseq encoding persistent QuickCheck | 11 | containers deepseq encoding QuickCheck quickcheck-instances servant |
13 | quickcheck-instances servant text | 12 | text |
14 | ]; | 13 | ]; |
15 | testHaskellDepends = [ | 14 | testHaskellDepends = [ |
16 | aeson base hspec QuickCheck quickcheck-instances | 15 | aeson base hspec QuickCheck quickcheck-instances |