git.iko.soy/typeable/file-embed
on master help sign in
Merge pull request #15 from phadej/tests-6.12

Enable tests on ghc 6.12.3

commit3ad217cb947f4b632bec2563c95b9fcdfd96b20e authorMichael Snoyman <michael@snoyman.com> dateFri 14 Aug 2015, 11:25 (11 years ago) parent2964c077125713
3 files changed+9−13
.travis.yml+3−11 file-embed.cabal−1 test/main.hs+6−1
.travis.yml+3−11
@@ -33,21 +33,13 @@ install:
3333 - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
3434 - travis_retry cabal update
3535 - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
36− - if [ $GHCVER = "6.12.3" ]; then
37− cabal install --only-dependencies;
38− else
39− cabal install --only-dependencies --enable-tests --enable-benchmarks;
40− fi
36+ - cabal install --only-dependencies --enable-tests --enable-benchmarks;
4137
4238script:
4339 - if [ -f configure.ac ]; then autoreconf -i; fi
44− - if [ $GHCVER = "6.12.3" ]; then
45− cabal configure -v2;
46− else
47− cabal configure --enable-tests --enable-benchmarks -v2;
48− fi
40+ - cabal configure --enable-tests --enable-benchmarks -v2;
4941 - cabal build # this builds all libraries and executables (including tests/benchmarks)
50− - if [ $GHCVER != "6.12.3" ]; then cabal test; fi
42+ - cabal test
5143 - cabal check
5244 - cabal sdist # tests that a source-distribution can be generated
5345
file-embed.cabal−1
@@ -32,7 +32,6 @@ test-suite test
3232 hs-source-dirs: test
3333 build-depends: base
3434 , file-embed
35− , HUnit
3635 , filepath
3736
3837source-repository head
test/main.hs+6−1
@@ -1,10 +1,15 @@
11{-# LANGUAGE TemplateHaskell #-}
22{-# LANGUAGE OverloadedStrings #-}
33
4+import Control.Monad (unless)
45import Data.FileEmbed
5−import Test.HUnit ((@?=))
66import System.FilePath ((</>))
77
8+infix 1 @?=
9+
10+(@?=) :: (Eq a, Show a) => a -> a -> IO ()
11+actual @?= expected = unless (actual == expected) (error $ "expected: " ++ show expected ++ "\n but got: " ++ show actual)
12+
813main :: IO ()
914main = do
1015 let received = $(embedDir "test/sample")