diff options
author | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2017-01-25 15:54:54 +0100 |
---|---|---|
committer | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2017-01-25 15:54:54 +0100 |
commit | 75d9fe614dca572aa1d7cfa53553e9c103eb2dd0 (patch) | |
tree | 54def052dcd8f288baead536a5f80d41a00387ef /server/test | |
parent | 99fc4947543c1916e9fec952526a688eb7753490 (diff) | |
download | thermoprint-75d9fe614dca572aa1d7cfa53553e9c103eb2dd0.tar thermoprint-75d9fe614dca572aa1d7cfa53553e9c103eb2dd0.tar.gz thermoprint-75d9fe614dca572aa1d7cfa53553e9c103eb2dd0.tar.bz2 thermoprint-75d9fe614dca572aa1d7cfa53553e9c103eb2dd0.tar.xz thermoprint-75d9fe614dca572aa1d7cfa53553e9c103eb2dd0.zip |
Cleanup test suite
Diffstat (limited to 'server/test')
-rw-r--r-- | server/test/Thermoprint/Server/Printer/GenericSpec.hs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/server/test/Thermoprint/Server/Printer/GenericSpec.hs b/server/test/Thermoprint/Server/Printer/GenericSpec.hs index 80096b0..e535754 100644 --- a/server/test/Thermoprint/Server/Printer/GenericSpec.hs +++ b/server/test/Thermoprint/Server/Printer/GenericSpec.hs | |||
@@ -29,8 +29,6 @@ import Data.Word | |||
29 | import Data.Sequence (Seq) | 29 | import Data.Sequence (Seq) |
30 | import qualified Data.Sequence as Seq | 30 | import qualified Data.Sequence as Seq |
31 | 31 | ||
32 | import Debug.Trace | ||
33 | |||
34 | instance IsString Line where | 32 | instance IsString Line where |
35 | fromString = (\(Right l) -> l) . text . TL.pack | 33 | fromString = (\(Right l) -> l) . text . TL.pack |
36 | 34 | ||
@@ -40,7 +38,7 @@ spec = do | |||
40 | zipWithM_ example [1..] examples | 38 | zipWithM_ example [1..] examples |
41 | where | 39 | where |
42 | example n (s, ts) = let str = show s | 40 | example n (s, ts) = let str = show s |
43 | in specify str $ traceDump (mkPrintout . Printout . fmap (Paragraph . Seq.singleton) . fmap Cooked $ s) == ts | 41 | in specify str $ (mkPrintout . Printout . fmap (Paragraph . Seq.singleton) . fmap Cooked $ s) == ts |
44 | 42 | ||
45 | final, initial :: L.ByteString | 43 | final, initial :: L.ByteString |
46 | initial = esc [64] <> esc [64] | 44 | initial = esc [64] <> esc [64] |
@@ -52,9 +50,6 @@ esc = L.BS.pack . (27:) | |||
52 | p :: L.ByteString -> L.ByteString | 50 | p :: L.ByteString -> L.ByteString |
53 | p = (<> final) . (initial <>) | 51 | p = (<> final) . (initial <>) |
54 | 52 | ||
55 | traceDump :: L.ByteString -> L.ByteString | ||
56 | traceDump bs = traceShow (map (\b -> (b, (toEnum $ fromEnum b) :: Char)) $ L.BS.unpack bs) bs | ||
57 | |||
58 | examples :: [(Seq Block, L.ByteString)] | 53 | examples :: [(Seq Block, L.ByteString)] |
59 | examples = [ ( [Line (JuxtaPos ["Hello", HSpace 1, "World!"])] | 54 | examples = [ ( [Line (JuxtaPos ["Hello", HSpace 1, "World!"])] |
60 | , p "Hello World!") | 55 | , p "Hello World!") |