swish 0.9.0.8 → 0.9.0.9
raw patch · 3 files changed
+34/−23 lines, 3 filesdep ~semigroupsdep ~text
Dependency ranges changed: semigroups, text
Files
- src/Swish/RDF/Parser/N3.hs +4/−4
- swish.cabal +13/−5
- tests/NTTest.hs +17/−14
src/Swish/RDF/Parser/N3.hs view
@@ -579,7 +579,7 @@ -} singleQuoted :: N3Parser T.Text-singleQuoted = T.pack <$> (bracket sQuot sQuot $ many n3Character)+singleQuoted = T.pack <$> bracket sQuot sQuot (many n3Character) {- tripleQUoted ::= """[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""@@ -605,12 +605,12 @@ ignore $ char '"' mb <- optional (char '"') case mb of- Just _ -> return $ "\"\""- _ -> return $ "\""+ Just _ -> return "\"\""+ _ -> return "\"" _multiQuote :: N3Parser T.Text _multiQuote = do- mq <- optional (oneOrTwo)+ mq <- optional oneOrTwo r <- noneOf "\"\\" return $ fromMaybe T.empty mq `T.snoc` r
swish.cabal view
@@ -1,5 +1,5 @@ Name: swish-Version: 0.9.0.8+Version: 0.9.0.9 Stability: experimental License: LGPL License-file: LICENSE @@ -44,9 +44,17 @@ . * Complete, ready-to-run, command-line and script-driven programs. .+ Changes in version @0.9.0.9@:+ .+ * Updated the upper bound on the semigroups dependency (thanks to + Leif Warner).+ .+ * Updated the upper bound on the text dependency (however, requires+ changes to intern and semigroups to use).+ . Changes in version @0.9.0.8@: .- * Updated the upper bound on the semigroup dependency (thanks to + * Updated the upper bound on the semigroups dependency (thanks to Leif Warner). . * Display library version when running the @runw3ctests@ executable@@ -109,7 +117,7 @@ . Changes in version @0.9.0.1@: .- * Updated the upper bound on the semigroup dependency (thanks to + * Updated the upper bound on the semigroups dependency (thanks to Leif Warner). . Changes in version @0.9.0.0@:@@ -158,8 +166,8 @@ network >= 2.2 && < 2.5, old-locale == 1.0.*, polyparse >= 1.6 && <= 1.9,- semigroups >= 0.5 && < 0.12,- text == 0.11.*,+ semigroups >= 0.5 && < 0.13,+ text >= 0.11 && < 1.1, time >= 1.1 && < 1.5 if impl(ghc < 7.4.0)
tests/NTTest.hs view
@@ -66,11 +66,13 @@ noError :: String noError = "" --- check that the --- parseNT input == parseNT (formatGraph (parse NT input))----roundTrip :: String -> T.Text -> Test-roundTrip lbl inp = +-- | Take the input graph and parse it (the first+-- graph), then convert this back to text and parse+-- the result, to give the second graph. The+-- two strings are the errors from the parses,+-- if any.+doRoundTrip :: T.Text -> (RDFGraph, RDFGraph, String, String)+doRoundTrip inp = let (pErr1, pGr1) = case parseNT inp of Right g -> (noError, g) Left s -> (s, emptyRDFGraph)@@ -80,6 +82,15 @@ (pErr2, pGr2) = case parseNT inp2 of Right g -> (noError, g) Left s -> (s, emptyRDFGraph)++ in (pGr1, pGr2, pErr1, pErr2)++-- check that the +-- parseNT input == parseNT (formatGraph (parse NT input))+--+roundTrip :: String -> T.Text -> Test+roundTrip lbl inp = + let (pGr1, pGr2, pErr1, pErr2) = doRoundTrip inp in TestList [ TestCase (assertEqual ("roundTrip-parsing1:"++lbl) noError pErr1)@@ -89,15 +100,7 @@ roundTripTF :: String -> T.Text -> TF.Test roundTripTF lbl inp = - let (pErr1, pGr1) = case parseNT inp of- Right g -> (noError, g)- Left s -> (s, emptyRDFGraph)- - inp2 = formatGraphAsLazyText pGr1- - (pErr2, pGr2) = case parseNT inp2 of- Right g -> (noError, g)- Left s -> (s, emptyRDFGraph)+ let (pGr1, pGr2, pErr1, pErr2) = doRoundTrip inp in TF.testGroup ("roundTrip:" ++ lbl) [ TF.testCase "parsing1" (noError @=? pErr1)