h*"4      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvw0.3.0.0  Safe-Inferredxyz{|}~ Safe-InferredK Safe-Inferred188 Safe-Inferred -1mockcat9Make 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-Inferred= ! ! 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).1/02435786.-+,:;<=>?91/02435786.-+,:;<=>?9 Safe-Inferred-9ldmockcatRun 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 () emockcat9Specify 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" |> ()) e 0 operationProgram "input.txt" "output.text" result shouldBe () abc\]`^_def abc\]`^_def Safe-Inferred -5lmockcatOptions for generating mocks. prefix: Stub function prefixsuffix: stub function suffixqmockcat(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.rmockcatDefault Options.*Stub function names are prefixed with @_@.smockcatCreate a mock of the typeclasses that returns a monad according to the l. 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 () tmockcat5Create 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 s.  class (Monad m) => FileOperation m where writeFile :: FilePath -> Text -> m () readFile :: FilePath -> m Text makeMock [t|FileOperation|] it "test runMockT" do result <- runMockT do _readFile $ "input.txt" |> pack "content" _writeFile $ "output.text" |> pack "content" |> () somethingProgram result shouldBe () pqtslmonr pqtslmonr  Safe-Inferredm41/092435786.-+,:;<=>?  abc\]`^_deflmonpqtsr    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdeffghijjklmnopqrsttuvwxyz{|}~        &mockcat-0.3.0.0-1YMFGopikCcCMkUuwslWQzTest.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 shouldApplyTimesGreaterThanEqualshouldApplyTimesLessThanEqualshouldApplyTimesGreaterThanshouldApplyTimesLessThanshouldApplyToAnythingshouldApplyTimesToAnything$fShowCountVerifyMethod$fVerifyOrderaa$fVerifyOrderParama$fVerifyCountIntaa $fVerifyCountCountVerifyMethodaa$fVerifyCountIntParama$$fVerifyCountCountVerifyMethodParama $fVerifyaa$fVerifyParama$fMockBuilderListFUNParam$fMockBuilderListFUN:>$fMockBuilderListFUN:>0$fMockBuilderListFUN:>1$fMockBuilderListFUN:>2$fMockBuilderListFUN:>3$fMockBuilderListFUN:>4$fMockBuilderListFUN:>5$fMockBuilderListFUN:>6$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 DefinitionsymbolmockverifyMockTstrunMockT applyTimesIs neverApply$fFunctorMockT$fApplicativeMockT $fMonadMockT$fMonadTransMockT$fMonadIOMockT MockOptionsprefixsuffixshowExp expectByExproptionsmakeMockWithOptionsmakeMock$fShowClassName2VarNames$fShowVarName2ClassNames$fShowVarAppliedTypeversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDirgetDataFileName getSysconfDirVerify