lambdatex 0.1.0.2 → 0.1.0.3
raw patch · 5 files changed
+16/−17 lines, 5 filesdep +quickcheck-textPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: quickcheck-text
API changes (from Hackage documentation)
- Text.LaTeX.LambdaTeX.Selection.Internal: matches :: [Text] -> [Text] -> Bool
+ Text.LaTeX.LambdaTeX.Part: instance GHC.Show.Show Text.LaTeX.LambdaTeX.Part.Part
Files
- lambdatex.cabal +4/−3
- src/Text/LaTeX/LambdaTeX/Part.hs +1/−0
- src/Text/LaTeX/LambdaTeX/Selection/Internal.hs +2/−5
- test/MainTest.hs +9/−0
- test/Spec.hs +0/−9
lambdatex.cabal view
@@ -1,5 +1,5 @@ name: lambdatex-version: 0.1.0.2+version: 0.1.0.3 synopsis: Type-Safe LaTeX EDSL description: ΛTeX, pronounced 'LambdaTeX' is a Haskell EDSL that adds type-safety to LaTeX.@@ -48,17 +48,18 @@ -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-orphans- -fforce-recomp default-language: Haskell2010 test-suite lambdatex-test type: exitcode-stdio-1.0 hs-source-dirs: test- main-is: Spec.hs+ main-is: MainTest.hs build-depends: base , lambdatex , hspec , QuickCheck+ , text >= 1.2 && < 1.3+ , quickcheck-text >= 0.1 && < 0.2 ghc-options: -threaded -rtsopts -with-rtsopts=-N default-language: Haskell2010
src/Text/LaTeX/LambdaTeX/Part.hs view
@@ -3,6 +3,7 @@ import Data.Text (Text) newtype Part = Part { unPart :: [Text] }+ deriving Show emptyPart :: Part emptyPart = Part { unPart = [] }
src/Text/LaTeX/LambdaTeX/Selection/Internal.hs view
@@ -17,10 +17,10 @@ go :: [Text] -> [Selector] -> Bool -> Bool go _ [] b = b go ps (All:ss) _ = go ps ss True- go ps ((Match s):ss) b = if ps `matches` s+ go ps ((Match s):ss) b = if (ps `isPrefixOf` s || s `isPrefixOf` ps) then go ps ss True else go ps ss b- go ps ((Ignore s):ss) True = if ps `matches` s+ go ps ((Ignore s):ss) True = if s `isPrefixOf` ps then go ps ss False else go ps ss True go ps ((Ignore _):ss) False = go ps ss False@@ -77,6 +77,3 @@ | otherwise = go ss (acc ++ [sc]) --- | Tests whether a given part matches a given selector's part specification-matches :: [Text] -> [Text] -> Bool-matches a b = (a `isPrefixOf` b) || (b `isPrefixOf` a)
+ test/MainTest.hs view
@@ -0,0 +1,9 @@+{-# OPTIONS_GHC -F -pgmF hspec-discover #-}+module MainTest where++import qualified Spec+import Test.Hspec.Formatters+import Test.Hspec.Runner++main :: IO ()+main = hspecWith defaultConfig {configFormatter = Just progress} Spec.spec
− test/Spec.hs
@@ -1,9 +0,0 @@-import Control.Exception (evaluate)-import Test.Hspec-import Test.QuickCheck--main :: IO ()-main = hspec $ do- describe "unfinished test suite" $ do- it "is not finished yet, so here's a dummy test" $ do- True