5
5
6
6
module Test.ScheduledMergesQLS (tests ) where
7
7
8
- import Control.Monad (void )
9
8
import Control.Monad.ST
10
9
import Control.Tracer (Tracer , nullTracer )
11
10
import Data.Constraint (Dict (.. ))
@@ -19,44 +18,18 @@ import Prelude hiding (lookup)
19
18
import ScheduledMerges as LSM
20
19
21
20
import Test.QuickCheck
22
- import qualified Test.QuickCheck.DynamicLogic as DL
23
21
import Test.QuickCheck.StateModel hiding (lookUpVar )
24
22
import Test.QuickCheck.StateModel.Lockstep hiding (ModelOp )
25
23
import qualified Test.QuickCheck.StateModel.Lockstep.Defaults as Lockstep
26
- import Test.QuickCheck.StateModel.Lockstep.Op.Identity (Op (OpId ))
27
24
import qualified Test.QuickCheck.StateModel.Lockstep.Run as Lockstep
28
25
import Test.Tasty
29
26
import Test.Tasty.QuickCheck (testProperty )
30
27
31
28
tests :: TestTree
32
29
tests = testGroup " Test.ScheduledMergesQLS" [
33
30
testProperty " ScheduledMerges vs model" $ mapSize (* 10 ) prop_LSM -- still <10s
34
- , testProperty " propRegression_issue755" $
35
- let scenario = do
36
- var1 <- DL. action $ ANew (LSMConfig {configMaxWriteBufferSize = 1 , configSizeRatio = 2 })
37
- void $ DL. action $ AInsert (unsafeMkGVar var1 OpId ) (Right (K 0 )) (V 0 ) Nothing
38
- var16 <- DL. action $ AUnions [unsafeMkGVar var1 OpId ]
39
- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 0 )) (V 0 ) Nothing
40
- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 1 )) (V 0 ) Nothing
41
- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 0 )) (V 0 ) Nothing
42
- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 0 )) (V 0 ) Nothing
43
- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 1 )) (V 0 ) Nothing
44
- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 2 )) (V 0 ) Nothing
45
- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 0 )) (V 0 ) Nothing
46
- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 0 )) (V 0 ) Nothing
47
- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 0 )) (V 0 ) Nothing
48
- in DL. forAllDL scenario prop_LSM
49
- {-
50
- The scenario above is a manually modified version of output produced by:
51
-
52
- cabal run prototypes-test -- \
53
- --quickcheck-replay="(SMGen 3702524042292853426 14344574976030159473,92)" \
54
- -p '/ScheduledMerges vs model/'
55
- -}
56
31
]
57
32
58
- instance DL. DynLogicModel (Lockstep Model ) where
59
-
60
33
-- TODO: add tagging, e.g. how often ASupplyUnion makes progress or completes a
61
34
-- union merge.
62
35
prop_LSM :: Actions (Lockstep Model ) -> Property
0 commit comments