interpol 0.2.2 → 0.2.3
raw patch · 4 files changed
+39/−30 lines, 4 filesdep +HUnitdep +test-frameworkdep +test-framework-hunitPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: HUnit, test-framework, test-framework-hunit
API changes (from Hackage documentation)
- Text.Interpol: instance [overlap ok] Show a => ToString a
- Text.Interpol: instance [overlap ok] ToString Char
- Text.Interpol: instance [overlap ok] ToString [Char]
+ Text.Interpol: instance [overlap ok] [safe] Show a => ToString a
+ Text.Interpol: instance [overlap ok] [safe] ToString Char
+ Text.Interpol: instance [overlap ok] [safe] ToString [Char]
Files
- Makefile +4/−3
- NEWS.md +6/−0
- Test/Unit.hs +15/−23
- interpol.cabal +14/−4
Makefile view
@@ -27,14 +27,15 @@ endef -test: install clean-tests+test: build clean-tests+ cabal test+ make install $(foreach t,$(TESTS1),cd Test && $(GHC) -F -pgmF interpol $(t)${\n}) $(foreach t,$(TESTS2),cd Test && $(GHC) $(t)${\n}) $(foreach t,$(TESTS1) $(TESTS2),cd Test && [ "`./$(t)`" = "I have 23 apples." ]${\n})- runhaskell Test/Unit.hs dist/setup-config: interpol.cabal- cabal configure+ cabal configure --enable-tests doc: build cabal haddock
NEWS.md view
@@ -1,6 +1,12 @@ News ==== +v0.2.3+------++Maintenance release for `v0.2.2`. Tests ported to `test-framework`.+All API change are backwards compatible.+ v0.2.2 ------
Test/Unit.hs view
@@ -1,30 +1,22 @@ module Main where -import System.Exit ( exitFailure )+import Data.Monoid++import Test.Framework+import Test.Framework.Providers.HUnit import Test.HUnit+ import Text.Interpol main :: IO ()-main = do- runCounts <- runTestTT $ test [ toStringTests ]- if failures runCounts + errors runCounts == 0- then- putStrLn "All unit tests pass :)"- else do- putStrLn "Failures or errors occured :'("- exitFailure+main = defaultMainWithOpts+ [ testCase "toString" testToString+ ] mempty -toStringTests :: Test-toStringTests =- test [ "string" ~: TestCase $ do- assertEqual "" "I have apples" ("I " ^-^ "have " ^-^ "apples")- , "char" ~: TestCase $ do- assertEqual "" "Triple 'X'" ("Triple " ^-^ 'X')- , "number" ~: TestCase $ do- assertEqual "" "Am 21 years old" ("Am " ^-^ (21 :: Int) ^-^- " years old")- , "first" ~: TestCase $ do- assertEqual "" "21 is my age" ((21 :: Int) ^-^ " is my age")- , "utf" ~: TestCase $ do- assertEqual "" "Umlaut: 'ü'" ("Umlaut: " ^-^ 'ü')- ]+testToString :: Assertion+testToString = do+ ("I " ^-^ "have " ^-^ "apples") @?= "I have apples"+ ("Triple " ^-^ 'X') @?= "Triple 'X'"+ ("Am " ^-^ (21 :: Int) ^-^ " years old") @?= "Am 21 years old"+ ((21 :: Int) ^-^ " is my age") @?= "21 is my age"+ ("Umlaut: " ^-^ 'ü') @?= "Umlaut: 'ü'"
interpol.cabal view
@@ -1,6 +1,6 @@ Name: interpol-Version: 0.2.2-Cabal-Version: >= 1.6+Version: 0.2.3+Cabal-Version: >= 1.8 License: GPL-3 License-File: LICENSE Stability: experimental@@ -25,8 +25,7 @@ Test/PureString.hs, Test/Simple.hs, Test/Standalone.hs,- Test/String.hs,- Test/Unit.hs+ Test/String.hs Data-files: README.md, NEWS.md @@ -41,4 +40,15 @@ Library Build-Depends: base >= 4 && <5 Ghc-options: -Wall+ Extensions: Safe Exposed-modules: Text.Interpol++Test-suite unit+ Hs-Source-Dirs: Test, .+ Main-Is: Unit.hs+ Type: exitcode-stdio-1.0++ Build-Depends: base >= 4 && <5, syb, haskell-src-exts, regex-posix+ Ghc-Options: -Wall++ Build-Depends: test-framework, test-framework-hunit, HUnit