cabal-helper 0.8.0.0 → 0.8.0.1
raw patch · 4 files changed
+40/−8 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- cabal-helper.cabal +1/−1
- src/CabalHelper/Runtime/Main.hs +0/−6
- tests/GhcSession.hs +13/−1
- tests/UnitTests.hs +26/−0
cabal-helper.cabal view
@@ -1,5 +1,5 @@ name: cabal-helper-version: 0.8.0.0+version: 0.8.0.1 synopsis: Simple interface to some of Cabal's configuration state, mainly used by ghc-mod description:
src/CabalHelper/Runtime/Main.hs view
@@ -760,13 +760,7 @@ #endif componentEntrypoints (CExe Executable {..}) = ChExeEntrypoint-#if CH_MIN_VERSION_Cabal(2,0,0)- --- ( head ((hsSourceDirs buildInfo) ++ ["."]) </> modulePath)- -- modulePath-#else modulePath-#endif (map gmModuleName $ otherModules buildInfo) componentEntrypoints (CTest TestSuite { testInterface = TestSuiteExeV10 _ fp, ..}) = ChExeEntrypoint fp (map gmModuleName $ otherModules testBuildInfo)
tests/GhcSession.hs view
@@ -144,8 +144,20 @@ ts <- mapM (\t -> guessTarget t Nothing) $ case ep of ChLibEntrypoint ms ms' ss -> map unChModuleName $ ms ++ ms' ++ ss- ChExeEntrypoint m ms -> [m] ++ map unChModuleName ms+ ChExeEntrypoint m' ms ->+ let++ -- The options first clear out includes, then put in the build dir. We want the+ -- first one after that, so "regex-example" in the following case+ --+ -- ,"-i"+ -- ,"-idist/build/regex-example"+ -- ,"-iregex-example"+ firstInclude = drop 2 $ head $ drop 2 $ filter (isPrefixOf "-i") opts+ m = firstInclude </> m'+ in [m] ++ map unChModuleName ms ChSetupEntrypoint -> ["Setup.hs"]+ let ts' = case nb of NoBuildOutput -> map (\t -> t { targetAllowObjCode = False }) ts ProduceBuildOutput -> ts
+ tests/UnitTests.hs view
@@ -0,0 +1,26 @@+import Test.Tasty+import Test.Tasty.HUnit+import Test.Tasty.SmallCheck++import Data.List++main :: IO ()+main = defaultMain $+ testGroup "Tests"+ [ testGroup "(checked by SmallCheck)"+ [ testProperty "sort == sort . reverse" $+ \list -> sort (list :: [Int]) == sort (reverse list)++ , testProperty "Fermat's last theorem" $+ \x y z n -> (n :: Integer) >= 3 ==>+ x^n + y^n /= (z^n :: Integer)+ ]++ , testGroup "Unit tests"+ [ testCase "List comparison (different length)" $+ [1, 2, 3] `compare` [1,2] @?= GT++ , testCase "List comparison (same length)" $+ [1, 2, 3] `compare` [1,2,2] @?= LT+ ]+ ]