diff options
author | John MacFarlane <jgm@berkeley.edu> | 2021-03-19 21:17:13 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-03-19 21:17:13 -0700 |
commit | dc94601eb5d90d315d8eae3bca57a652da3fa598 (patch) | |
tree | 8bad8923d2e3deeb1867e38f867932a3d6a65b3b /test/Tests/Old.hs | |
parent | 2ca1b20a85303dc8656f782f5804afdec215948b (diff) | |
download | pandoc-dc94601eb5d90d315d8eae3bca57a652da3fa598.tar.gz |
Tests: factor out setupEnvironment in Test.Helpers.
This avoids code duplication between Command and Old.
Diffstat (limited to 'test/Tests/Old.hs')
-rw-r--r-- | test/Tests/Old.hs | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/test/Tests/Old.hs b/test/Tests/Old.hs index e890bad0b..c7b164f3c 100644 --- a/test/Tests/Old.hs +++ b/test/Tests/Old.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE TupleSections #-} {- | Module : Tests.Old Copyright : © 2006-2021 John MacFarlane @@ -15,7 +14,6 @@ module Tests.Old (tests) where import Data.Algorithm.Diff import System.Exit import System.FilePath ((<.>), (</>)) -import qualified System.Environment as Env import System.Environment.Executable (getExecutablePath) import Text.Pandoc.Process (pipeProcess) import Test.Tasty (TestTree, testGroup) @@ -319,16 +317,7 @@ testWithNormalize normalizer pandocPath testname opts inp norm = (compareValues norm options) updateGolden where getExpected = normalizer <$> readFile' norm getActual = do - mldpath <- Env.lookupEnv "LD_LIBRARY_PATH" - mdyldpath <- Env.lookupEnv "DYLD_LIBRARY_PATH" - mpdd <- Env.lookupEnv "pandoc_datadir" - let env = ("TMP",".") : - ("LANG","en_US.UTF-8") : - ("HOME", "./") : - maybe [] ((:[]) . ("pandoc_datadir",)) mpdd ++ - maybe [] ((:[]) . ("LD_LIBRARY_PATH",)) mldpath ++ - maybe [] ((:[]) . ("DYLD_LIBRARY_PATH",)) mdyldpath - + env <- setupEnvironment pandocPath (ec, out) <- pipeProcess (Just env) pandocPath ("--emulate":options) mempty if ec == ExitSuccess |