hw-succinct 0.0.0.3 → 0.0.0.4
raw patch · 3 files changed
+34/−6 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- hw-succinct.cabal +2/−2
- test/HaskellWorks/Data/Json/Succinct/CursorSpec.hs +4/−4
- test/data/sample.json +28/−0
hw-succinct.cabal view
@@ -1,5 +1,5 @@ name: hw-succinct-version: 0.0.0.3+version: 0.0.0.4 synopsis: Conduits for tokenizing streams. description: Please see README.md homepage: http://github.com/haskell-works/hw-succinct#readme@@ -12,7 +12,7 @@ build-type: Simple extra-source-files: README.md cabal-version: >= 1.10-data-dir: test/data+data-files: test/data/sample.json executable hw-succinct-example hs-source-dirs: app
test/HaskellWorks/Data/Json/Succinct/CursorSpec.hs view
@@ -183,7 +183,7 @@ let cursor = "[null, {\"field\": 1}]" :: JsonCursor BS.ByteString t u cd ((ns . fc . ns . fc) cursor) `shouldBe` 3 it "can navigate down and forwards" $ do- (fptr, offset, size) <- mmapFileForeignPtr "test/Resources/sample.json" ReadOnly Nothing+ (fptr, offset, size) <- mmapFileForeignPtr "test/data/sample.json" ReadOnly Nothing let cursor = fromForeignRegion (fptr, offset, size) :: JsonCursor BS.ByteString t u jsonCursorType cursor `shouldBe` JsonCursorObject jsonCursorType (( fc) cursor) `shouldBe` JsonCursorString@@ -199,7 +199,7 @@ jsonCursorType (( ns . ns . ns . ns . fc . ns . ns . ns . fc . ns . fc) cursor) `shouldBe` JsonCursorString jsonCursorType ((ns . ns . ns . ns . ns . fc . ns . ns . ns . fc . ns . fc) cursor) `shouldBe` JsonCursorNumber it "can navigate up" $ do- (fptr, offset, size) <- mmapFileForeignPtr "test/Resources/sample.json" ReadOnly Nothing+ (fptr, offset, size) <- mmapFileForeignPtr "test/data/sample.json" ReadOnly Nothing let cursor = fromForeignRegion (fptr, offset, size) :: JsonCursor BS.ByteString t u ( pn . fc) cursor `shouldBe` cursor ( pn . ns . fc) cursor `shouldBe` cursor@@ -214,7 +214,7 @@ ( pn . ns . ns . ns . ns . fc . ns . ns . ns . fc . ns . fc) cursor `shouldBe` (ns . ns . ns . fc . ns . fc) cursor ( pn . ns . ns . ns . ns . ns . fc . ns . ns . ns . fc . ns . fc) cursor `shouldBe` (ns . ns . ns . fc . ns . fc) cursor it "can get subtree size" $ do- (fptr, offset, size) <- mmapFileForeignPtr "test/Resources/sample.json" ReadOnly Nothing+ (fptr, offset, size) <- mmapFileForeignPtr "test/data/sample.json" ReadOnly Nothing let cursor = fromForeignRegion (fptr, offset, size) :: JsonCursor BS.ByteString t u ss cursor `shouldBe` 45 ss (( fc) cursor) `shouldBe` 1@@ -230,7 +230,7 @@ ss (( ns . ns . ns . ns . fc . ns . ns . ns . fc . ns . fc) cursor) `shouldBe` 1 ss ((ns . ns . ns . ns . ns . fc . ns . ns . ns . fc . ns . fc) cursor) `shouldBe` 1 it "can get token at cursor" $ do- (fptr, offset, size) <- mmapFileForeignPtr "test/Resources/sample.json" ReadOnly Nothing+ (fptr, offset, size) <- mmapFileForeignPtr "test/data/sample.json" ReadOnly Nothing let cursor = fromForeignRegion (fptr, offset, size) :: JsonCursor BS.ByteString t u jsonTokenAt cursor `shouldBe` JsonTokenBraceL jsonTokenAt (( fc) cursor) `shouldBe` JsonTokenString "widget"
+ test/data/sample.json view
@@ -0,0 +1,28 @@+{+ "widget": {+ "debug": "on",+ "window": {+ "title": "Sample Konfabulator Widget",+ "name": "main_window",+ "width": 500,+ "height": 500+ },+ "image": {+ "src": "Images/Sun.png",+ "name": "sun1",+ "hOffset": 250,+ "vOffset": 250,+ "alignment": "center"+ },+ "text": {+ "data": "Click Here",+ "size": 36,+ "style": "bold",+ "name": "text1",+ "hOffset": 250,+ "vOffset": 100,+ "alignment": "center",+ "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"+ }+ }+}