Extract some convenience parsing functions
This commit is contained in:
32
test/Graphics/Fountainhead/MetricsSpec.hs
Normal file
32
test/Graphics/Fountainhead/MetricsSpec.hs
Normal file
@ -0,0 +1,32 @@
|
||||
{- This Source Code Form is subject to the terms of the Mozilla Public License,
|
||||
v. 2.0. If a copy of the MPL was not distributed with this file, You can
|
||||
obtain one at https://mozilla.org/MPL/2.0/. -}
|
||||
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Graphics.Fountainhead.MetricsSpec
|
||||
( spec
|
||||
) where
|
||||
|
||||
import Graphics.Fountainhead.Metrics
|
||||
import Test.Hspec (Spec, describe, it, shouldBe)
|
||||
|
||||
spec :: Spec
|
||||
spec =
|
||||
describe "collectMetrics" $
|
||||
it "collects information from the name table" $ do
|
||||
let expected = FontDescriptor
|
||||
{ fontName = "fontName"
|
||||
, flags = []
|
||||
, fullName = "fullName"
|
||||
, familyName = "familyName"
|
||||
, weight = "weight"
|
||||
, fontBBox = FontBBox 0 0 0 0
|
||||
, version = "1.0.0"
|
||||
, notice = "Notice"
|
||||
, encodingScheme = "encodingScheme"
|
||||
, isFixedPitch = False
|
||||
, ascender = 0
|
||||
, descender = 0
|
||||
}
|
||||
in collectMetrics `shouldBe` expected
|
5
test/Spec.hs
Normal file
5
test/Spec.hs
Normal file
@ -0,0 +1,5 @@
|
||||
{- This Source Code Form is subject to the terms of the Mozilla Public License,
|
||||
v. 2.0. If a copy of the MPL was not distributed with this file, You can
|
||||
obtain one at https://mozilla.org/MPL/2.0/. -}
|
||||
|
||||
{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
|
Reference in New Issue
Block a user