call-alloy 0.4.1 → 0.4.1.1
raw patch · 3 files changed
+21/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- call-alloy.cabal +8/−1
- test/Language/Alloy/CallSpec.hs +9/−2
ChangeLog.md view
@@ -4,6 +4,10 @@ ## Released changes +### 0.4.1.1++- introduce flag for testing different SAT solvers+ ### 0.4.1 - add support for different SAT solvers
call-alloy.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: call-alloy-version: 0.4.1+version: 0.4.1.1 synopsis: A simple library to call Alloy given a specification description: Please see the README on GitHub at <https://github.com/marcellussiegburg/call-alloy#readme> category: Language@@ -36,6 +36,11 @@ type: git location: https://github.com/marcellussiegburg/call-alloy +flag test-different-solvers+ description: During tests different solvers are called to test if they are working on the current system+ manual: True+ default: False+ library exposed-modules: Language.Alloy.Call@@ -115,3 +120,5 @@ else build-depends: unix >=2.7 && <2.9+ if flag(test-different-solvers)+ cpp-options: -DTEST_DIFFERENT_SOLVERS
test/Language/Alloy/CallSpec.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE StandaloneDeriving #-}@@ -5,8 +6,10 @@ module Language.Alloy.CallSpec (spec) where import Control.Concurrent.Async (forConcurrently)+#if TEST_DIFFERENT_SOLVERS import Data.Foldable (for_) import Data.List ((\\))+#endif import Data.Map (Map) import Data.Set (Set) import Data.String.Interpolate (i)@@ -14,7 +17,9 @@ import Language.Alloy.Call ( CallAlloyConfig (..),+#if TEST_DIFFERENT_SOLVERS SatSolver (..),+#endif defaultCallAlloyConfig, existsInstance, getInstances,@@ -42,6 +47,9 @@ getInstances (Just 1) "pred a (a: Int) { a > a }\nrun a" `shouldReturn` [] it "giving not enough time should return no result" $ getInstancesWith cfg "pred a (a: Int) { a >= a }\nrun a" `shouldReturn` []+#if TEST_DIFFERENT_SOLVERS+ let untested = [BerkMin, Spear]+ solvers = [minBound ..] \\ untested for_ solvers $ \solver -> it ("using solver " ++ show solver ++ " generates an instance") $ do xs <- length <$> getInstancesWith@@ -52,6 +60,7 @@ } (graph 2) xs `shouldBe` 1+#endif it "called in parallel does not create issues" $ do ys <- forConcurrently [1 .. 6] $ \x -> length <$> getInstances (Just $ x ^ (3 :: Integer)) (graph x)@@ -66,8 +75,6 @@ maxInstances = Nothing, timeout = Just 0 }- untested = [BerkMin, Spear]- solvers = [minBound ..] \\ untested graph :: Integer -> String graph x = [i|