summaryrefslogtreecommitdiff
path: root/test/Graphics/Fountainhead
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2024-02-07 10:40:00 +0100
committerEugen Wissner <belka@caraus.de>2024-02-07 10:40:00 +0100
commitc5f715ac7cdfb663fc84cb9fe841903b5aed99c5 (patch)
tree698f1bb31fcfbca25f19d2cd31f94390d0bf47ba /test/Graphics/Fountainhead
parent23271d6f6cf033230106f07ae14985f3b85f906a (diff)
downloadfountainhead-c5f715ac7cdfb663fc84cb9fe841903b5aed99c5.tar.gz
Extract some convenience parsing functions
Diffstat (limited to 'test/Graphics/Fountainhead')
-rw-r--r--test/Graphics/Fountainhead/MetricsSpec.hs32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/Graphics/Fountainhead/MetricsSpec.hs b/test/Graphics/Fountainhead/MetricsSpec.hs
new file mode 100644
index 0000000..d122579
--- /dev/null
+++ b/test/Graphics/Fountainhead/MetricsSpec.hs
@@ -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