git.iko.soy/typeable/hjsonpointer
on master help sign in
0.3.0.2. Switch to hspec for tests.
commit92621b1d6ea83e0aea10a2fdfdb0c8122ef64c72 authorIan Grant Jeffries <ian@housejeffries.com> dateMon 11 Jul 2016, 10:39 (10 years ago) parent3389617
4 files changed+32−28
Example.hs+1−1 changelog.md+9−1 hjsonpointer.cabal+9−16 tests/Unit.hs → test/Unit.hs+13−10
Example.hs+1−1
@@ -1,6 +1,6 @@
11{-# LANGUAGE OverloadedStrings #-}
22
3−module Main where
3+module Example where
44
55import Control.Monad (unless)
66import Data.Aeson
changelog.md+9−1
@@ -1,4 +1,12 @@
1−# 0.3
1+# 0.3.0.2
2+
3++ Switch to hspec for tests.
4+
5+# 0.3.0.1
6+
7++ Enable GHC 8.
8+
9+# 0.3.0.0
210
311+ Rewrite.
412
hjsonpointer.cabal+9−16
@@ -1,5 +1,5 @@
11name: hjsonpointer
2−version: 0.3.0.1
2+version: 0.3.0.2
33synopsis: JSON Pointer library
44homepage: https://github.com/seagreen/hjsonpointer
55license: MIT
@@ -22,37 +22,30 @@ library
2222 ghc-options: -Wall
2323 build-depends: aeson >= 0.7 && < 0.12
2424 , base >= 4.6 && < 4.10
25− , QuickCheck >= 2.8 && < 2.9
25+ , QuickCheck >= 2.8 && < 2.10
2626 , unordered-containers >= 0.2 && < 0.3
2727 , text >= 1.2 && < 1.3
2828 , vector >= 0.10 && < 0.12
2929
3030test-suite unit
3131 type: exitcode-stdio-1.0
32− hs-source-dirs: tests
32+ hs-source-dirs: test
33+ ./
3334 main-is: Unit.hs
35+ other-modules: Example
3436 default-language: Haskell2010
3537 ghc-options: -Wall
3638 default-extensions: OverloadedStrings
3739 build-depends: aeson
3840 , base
3941 , hjsonpointer
42+ , QuickCheck
4043 , unordered-containers
4144 , text
4245 , vector
43− , http-types >= 0.8 && < 0.10
44− , HUnit >= 1.2 && < 1.4
45− , test-framework >= 0.8 && < 0.9
46− , test-framework-hunit >= 0.3 && < 0.4
47− , test-framework-quickcheck2 >= 0.3 && < 0.4
48−
49−executable example
50− main-is: Example.hs
51− default-language: Haskell2010
52− ghc-options: -Wall
53− build-depends: aeson
54− , base
55− , hjsonpointer
46+ , hspec >= 2.2 && < 2.3
47+ , http-types >= 0.8 && < 0.10
48+ , HUnit >= 1.2 && < 1.4
5649
5750source-repository head
5851 type: git
tests/Unit.hs → test/Unit.hsrenamed+13−10
@@ -9,9 +9,10 @@ import qualified Data.Text as T
99import Data.Text.Encoding
1010import qualified Data.Vector as V
1111import Network.HTTP.Types.URI (urlDecode)
12−import Test.Framework (defaultMain, testGroup)
13−import Test.Framework.Providers.HUnit (testCase)
14−import Test.Framework.Providers.QuickCheck2 (testProperty)
12+
13+import Test.Hspec
14+import Test.QuickCheck (property)
15+
1516import Test.HUnit hiding (Test)
1617
1718-- For GHCs before 7.10:
@@ -19,14 +20,16 @@ import Control.Applicative
1920import Data.Foldable
2021import Data.Monoid
2122
23+import qualified Example
24+
2225main :: IO ()
23−main = defaultMain
24− [ testGroup "unit"
25− [ testProperty "Storing a Pointer as JSON doesn't change its value" roundtrip
26− , testCase "Can be represented in a JSON string value" jsonString
27− , testCase "Can be represented in a URI fragment identifier" uriFragment
28− ]
29− ]
26+main = hspec $ do
27+ describe "example" $ do
28+ it "compiles and runs without errors" Example.main
29+ describe "pointers" $ do
30+ it "can be stored as JSON without changing its value" (property roundtrip)
31+ it "can be represented in a JSON string value" jsonString
32+ it "can be represented in a URI fragment identifier" uriFragment
3033
3134roundtrip :: P.Pointer -> Bool
3235roundtrip a = Just a == decode (encode a)