pandoc-citeproc 0.8.1.2 → 0.8.1.3
raw patch · 4 files changed
+21/−15 lines, 4 files
Files
- changelog +5/−0
- man/man1/pandoc-citeproc.1 +1/−1
- pandoc-citeproc.cabal +1/−1
- tests/test-pandoc-citeproc.hs +14/−13
changelog view
@@ -1,3 +1,8 @@+pandoc-citeproc (0.8.1.3)++ * test-pandoc-citeproc: Better fix for Windows. Use UTF8 strings+ instead of bytestrings; this helps get line endings right in tests.+ pandoc-citeproc (0.8.1.2) * Use UTF8 versions of readFile in test program.
man/man1/pandoc-citeproc.1 view
@@ -2,7 +2,7 @@ .\" Automatically generated by Pandoc 1.15.1.1 .\" .hy-.TH "pandoc\-citeproc" "1" "2015-11-14" "pandoc-citeproc 0.8.1.1" ""+.TH "pandoc\-citeproc" "1" "2015-11-14" "pandoc-citeproc 0.8.1.3" "" .SH NAME .PP pandoc\-citeproc \- filter to resolve citations in a pandoc document.
pandoc-citeproc.cabal view
@@ -1,5 +1,5 @@ name: pandoc-citeproc-version: 0.8.1.2+version: 0.8.1.3 cabal-version: >= 1.12 synopsis: Supports using pandoc with citeproc
tests/test-pandoc-citeproc.hs view
@@ -79,8 +79,7 @@ then err "PASSED" >> return Passed else do err $ "FAILED"- showDiff (UTF8.fromStringLazy $ writeNative def expectedDoc)- (UTF8.fromStringLazy $ writeNative def outDoc)+ showDiff (writeNative def expectedDoc) (writeNative def outDoc) when regenerate $ UTF8.writeFile ("tests/" ++ csl ++ ".expected.native") $ writeNative def{ writerStandalone = True } outDoc@@ -91,13 +90,13 @@ err $ UTF8.toStringLazy errout return Errored -showDiff :: BL.ByteString -> BL.ByteString -> IO ()-showDiff expected' result' =+showDiff :: String -> String -> IO ()+showDiff expected result = withSystemTempDirectory "test-pandoc-citeproc-XXX" $ \fp -> do let expectedf = fp </> "expected" let actualf = fp </> "actual"- BL.writeFile expectedf expected'- BL.writeFile actualf result'+ UTF8.writeFile expectedf expected+ UTF8.writeFile actualf result oldDir <- getCurrentDirectory setCurrentDirectory fp rawSystem "diff" ["-U1","expected","actual"]@@ -107,18 +106,20 @@ biblio2yamlTest fp = do hPutStr stderr $ "[biblio2yaml/" ++ fp ++ "] " let yamlf = "tests/biblio2yaml/" ++ fp- raw <- BL.readFile yamlf- let yamlStart = BL.pack "---"- let (biblines, yamllines) = break (== yamlStart) $ BL.lines raw- let bib = BL.unlines biblines- let expected = BL.unlines yamllines+ raw <- UTF8.readFile yamlf+ let yamlStart = "---"+ let (biblines, yamllines) = break (== yamlStart) $ lines raw+ let bib = unlines biblines+ let expected = unlines yamllines testProgPath <- getExecutablePath let pandocCiteprocPath = takeDirectory testProgPath </> ".." </> "pandoc-citeproc" </> "pandoc-citeproc"- (ec, result, errout) <- pipeProcess+ (ec, result', errout) <- pipeProcess (Just [("LANG","en_US.UTF-8"),("HOME",".")]) pandocCiteprocPath- ["--bib2yaml", "-f", drop 1 $ takeExtension fp] bib+ ["--bib2yaml", "-f", drop 1 $ takeExtension fp]+ (UTF8.fromStringLazy bib)+ let result = UTF8.toStringLazy result' if ec == ExitSuccess then do if expected == result