h*+)      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~0.5.2.0  Safe-InferredP Safe-Inferred Safe-Inferred188 Safe-Inferred -1+mockcat9Make a parameter to which any value is expected to apply.mockcatCreate a conditional parameter.When applying a mock function, if the argument does not satisfy this condition, an error occurs.In this case, the specified label is included in the error message.mockcatCreate a conditional parameter.In applied a mock function, if the argument does not satisfy this condition, an error occurs.Unlike , it does not require a label, but the error message is displayed as [some condition].     8 Safe-Inferredy ! ! Safe-Inferred '+mockcat3Verify functions are applied in the expected order. import Test.Hspec import Test.MockCat import Prelude hiding (any) ... it "verify order of apply" do m <- createMock $ any |> True |> () print $ stubFn m "a" True print $ stubFn m "b" True m `shouldApplyInOrder` ["a" |> True, "b" |> True] ,mockcat8Verify that functions are applied in the expected order.Unlike +-, not all applications need to match exactly.8As long as the order matches, the verification succeeds.-mockcatVerify the number of times a function has been applied to an argument. import Test.Hspec import Test.MockCat ... it "verify to applied times." do m <- createMock $ "value" |> True print $ stubFn m "value" print $ stubFn m "value" m `shouldApplyTimes` (2 :: Int) `to` "value" mockcat"Class for verifying mock function..mockcatVerifies that the function has been applied to the expected arguments./mockcat9Class for creating a mock corresponding to the parameter.2mockcatCreate a mock. From this mock, you can generate stub functions and verify the functions.  import Test.Hspec import Test.MockCat ... it "stub & verify" do -- create a mock m <- createMock $ "value" |> True -- stub function let f = stubFn m -- assert f "value" `shouldBe` True -- verify m `shouldApplyTo` "value" If you do not need verification and only need stub functions, you can use mockFun.3mockcatCreate a constant mock. From this mock, you can generate constant functions and verify the functions.  import Test.Hspec import Test.MockCat ... it "stub & verify" do m <- createConstantMock "foo" stubFn m `shouldBe` "foo" shouldApplyToAnything m 4mockcatCreate a named mock. If the test fails, this name is used. This may be useful if you have multiple mocks.  import Test.Hspec import Test.MockCat ... it "named mock" do m <- createNamedMock "mock" $ "value" |> True stubFn m "value" `shouldBe` True 5mockcatCreate a named constant mock.6mockcat(Extract the stub function from the mock.7mockcatCreate a stub function.  import Test.Hspec import Test.MockCat ... it "stub function" do f <- createStubFn $ "value" |> True f "value" `shouldBe` True 8mockcatCreate a named stub function.:mockcatVerify that the function has been applied to the expected arguments at least the expected number of times.;mockcatVerify that the function is applied to the expected arguments less than or equal to the expected number of times.<mockcatVerify that the function has been applied to the expected arguments a greater number of times than expected.=mockcatVerify that the function has been applied to the expected arguments less than the expected number of times.>mockcat%Verify that it was apply to anything.?mockcat-Verify that it was apply to anything (times).@mockcatMake a case for stub functions. This can be used to create stub functions that return different values depending on their arguments.  it "test" do f <- createStubFn $ do onCase $ "a" |> "return x" onCase $ "b" |> "return y" f "a" shouldBe "return x" f "b" shouldBe "return y" AmockcatMake a list of patterns of arguments and returned values. This can be used to create stub functions that return different values depending on their arguments.  it "test" do f <- createStubFn $ cases [ "a" |> "return x", "b" |> "return y" ] f "a" shouldBe "return x" f "b" shouldBe "return y" BmockcatIO version of A. casesIO ["a", ""] has the same meaning as "cases [ pure @IO "a", pure @IO ""].1/02435786.-+,:;<=>?9@AB1/02435786.-+,:;<=>?9@AB Safe-Inferred-9lmockcatRun MockT monad. After run, verification is performed to see if the stub function has been applied.  import Test.Hspec import Test.MockCat ... class (Monad m) => FileOperation m where writeFile :: FilePath -> Text -> m () readFile :: FilePath -> m Text operationProgram :: FileOperation m => FilePath -> FilePath -> m () operationProgram inputPath outputPath = do content <- readFile inputPath writeFile outputPath content makeMock [t|FileOperation|] spec :: Spec spec = do it "test runMockT" do result <- runMockT do _readFile $ "input.txt" |> pack "content" _writeFile $ "output.text" |> pack "content" |> () operationProgram "input.txt" "output.text" result shouldBe () mmockcat9Specify how many times a stub function should be applied.  import Test.Hspec import Test.MockCat ... class (Monad m) => FileOperation m where writeFile :: FilePath -> Text -> m () readFile :: FilePath -> m Text operationProgram :: FileOperation m => FilePath -> FilePath -> m () operationProgram inputPath outputPath = do content <- readFile inputPath when (content == pack "ng") $ writeFile outputPath content makeMock [t|FileOperation|] spec :: Spec spec = do it "test runMockT" do result <- runMockT do _readFile ("input.txt" |> pack "content") _writeFile ("output.text" |> pack "content" |> ()) m 0 operationProgram "input.txt" "output.text" result shouldBe () ijkdehfglmn ijkdehfglmn Safe-Inferred -(tmockcatOptions for generating mocks.prefix: Stub function prefixsuffix: stub function suffiximplicitMonadicReturn: If True, the return value of the stub function is wrapped in a monad automatically. If Else, the return value of stub function is not wrapped in a monad, so required explicitly return monadic values.zmockcat(Create a conditional parameter based on Q Exp.In applying a mock function, if the argument does not satisfy this condition, an error is raised.=The conditional expression is displayed in the error message.{mockcatDefault Options.*Stub function names are prefixed with @_@.|mockcatCreate a mock of the typeclasses that returns a monad according to the t.1Given a monad type class, generate the following.%MockT instance of the given typeclassA stub function corresponding to a function of the original class type. The name of stub function is the name of the original function with a @_@ appended.  class (Monad m) => FileOperation m where writeFile :: FilePath -> Text -> m () readFile :: FilePath -> m Text makeMockWithOptions [t|FileOperation|] options { prefix = "stub_" } it "test runMockT" do result <- runMockT do stub_readFile $ "input.txt" |> pack "content" stub_writeFile $ "output.text" |> pack "content" |> () somethingProgram result shouldBe () }mockcat4Create a mock of a typeclasses that returns a monad.1Given a monad type class, generate the following.%MockT instance of the given typeclassA stub function corresponding to a function of the original class type. The name of stub function is the name of the original function with a @_@ appended./The prefix can be changed. In that case, use |.  class (Monad m) => FileOperation m where writeFile :: FilePath -> Text -> m () readFile :: FilePath -> m Text makeMock [t|FileOperation|] spec :: Spec spec = do it "test runMockT" do result <- runMockT do _readFile $ "input.txt" |> pack "content" _writeFile $ "output.text" |> pack "content" |> () somethingProgram result shouldBe () ~mockcat Finder a b m | a -> b, b -> a where findIds :: m [a] findById :: a -> m b instance Finder Int String IO where findIds = pure [1, 2, 3] findById id = pure $ "{id: " <> show id <> "}" findValue :: Finder a b m => m [b] findValue = do ids <- findIds mapM findById ids makePartialMock [t|Finder|] spec :: Spec spec = do it "Use all real functions." do values <- runMockT findValue values shouldBe ["{id: 1}", "{id: 2}", "{id: 3}"] it "Only findIds should be stubbed." do values <- runMockT do _findIds [1 :: Int, 2] findValue values shouldBe ["{id: 1}", "{id: 2}"] mockcat~ with options yz}|tuwvx{~ yz}|tuwvx{~  Safe-Inferred(:1/09A2435786.-+,:;<=>?@B  ijkdehfglmntuwvxyz}|{~    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnnopqrrstuvwxyz{||}~        &mockcat-0.5.2.0-Fz0Sz9czvPG4Ma7AOYHeiLTest.MockCat.AssociationListTest.MockCat.ConsTest.MockCat.ParamTest.MockCat.ParamDividerTest.MockCat.MockTest.MockCat.MockTTest.MockCat.THmockcat Paths_mockcat Test.MockCatAssociationListemptyinsertlookupmember!?update:>$fEq:>$fShow:>|>Param ExpectValueExpectConditionvalueparamanyexpectexpect_ $fEqParam $fShowParam$fShowParamParam$fShowParamParam0 $fConsGenab:>$fConsGenaParam:>$fConsGenParamb:>$fConsGenParamParam:>$fConsGenParam:>:>$fConsGena:>:> ParamDividerargsreturn returnValue$fParamDivider:>ParamParam$fParamDivider:>:>Param$fParamDivider:>:>Param0$fParamDivider:>:>Param1$fParamDivider:>:>Param2$fParamDivider:>:>Param3$fParamDivider:>:>Param4$fParamDivider:>:>Param5$fParamDivider:>:>Param6shouldApplyInOrdershouldApplyInPartialOrdershouldApplyTimes shouldApplyTo MockBuilderbuildMock createMockcreateConstantMockcreateNamedMockcreateNamedConstantMockstubFn createStubFncreateNamedStubFnto shouldApplyTimesGreaterThanEqualshouldApplyTimesLessThanEqualshouldApplyTimesGreaterThanshouldApplyTimesLessThanshouldApplyToAnythingshouldApplyTimesToAnythingonCasecasescasesIO$fShowCountVerifyMethod$fVerifyOrderaa$fVerifyOrderParama$fVerifyCountIntaa $fVerifyCountCountVerifyMethodaa$fVerifyCountIntParama$$fVerifyCountCountVerifyMethodParama $fVerifyaa$fVerifyParama$fMockBuilderIOIO()$fMockBuilderParamr()$fMockBuilder:>FUNParam$fMockBuilder:>FUN:>$fMockBuilder:>FUN:>0$fMockBuilder:>FUN:>1$fMockBuilder:>FUN:>2$fMockBuilder:>FUN:>3$fMockBuilder:>FUN:>4$fMockBuilder:>FUN:>5$fMockBuilder:>FUN:>6 $fMonadCases$fApplicativeCases$fFunctorCases$fMockBuilderCasesIO()$fMockBuilderCasesFUNParam$fMockBuilderCasesFUN:>$fMockBuilderCasesFUN:>0$fMockBuilderCasesFUN:>1$fMockBuilderCasesFUN:>2$fMockBuilderCasesFUN:>3$fMockBuilderCasesFUN:>4$fMockBuilderCasesFUN:>5$fMockBuilderCasesFUN:>6 DefinitionsymbolmockverifyMockTstrunMockT applyTimesIs neverApply$fFunctorMockT$fApplicativeMockT $fMonadMockT$fMonadTransMockT$fMonadIOMockT MockOptionsprefixsuffiximplicitMonadicReturnshowExp expectByExproptionsmakeMockWithOptionsmakeMockmakePartialMockmakePartialMockWithOptions$fShowClassName2VarNames$fShowVarName2ClassNames$fShowVarAppliedType $fEqMockTypeversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDirgetDataFileName getSysconfDirVerify