diff --git a/src/Streamly/Internal/FileSystem/Event/Darwin.m b/src/Streamly/Internal/FileSystem/Event/Darwin.c similarity index 100% rename from src/Streamly/Internal/FileSystem/Event/Darwin.m rename to src/Streamly/Internal/FileSystem/Event/Darwin.c diff --git a/streamly.cabal b/streamly.cabal index 6f0d82d858..01269cd78f 100644 --- a/streamly.cabal +++ b/streamly.cabal @@ -442,7 +442,7 @@ library if os(darwin) include-dirs: src/Streamly/Internal - c-sources: src/Streamly/Internal/FileSystem/Event/Darwin.m + c-sources: src/Streamly/Internal/FileSystem/Event/Darwin.c exposed-modules: Streamly.Internal.FileSystem.Event.Darwin if os(linux) diff --git a/test/Streamly/Test/Data/Parser.hs b/test/Streamly/Test/Data/Parser.hs index f17e214c9d..6bb7b9294d 100644 --- a/test/Streamly/Test/Data/Parser.hs +++ b/test/Streamly/Test/Data/Parser.hs @@ -1378,6 +1378,15 @@ expectedResult moves inp = go 0 0 [] moves P.Done n () -> (Right ys, slice_ (max (i - n + 1) j) inp) P.Error err -> (Left (ParseError err), slice_ j inp) +expectedResultMany :: [Move] -> [Int] -> [Either ParseError [Int]] +expectedResultMany _ [] = [] +expectedResultMany moves inp = + let (res, rest) = expectedResult moves inp + in + case res of + Left err -> [Left err] + Right val -> Right val : expectedResultMany moves rest + createPaths :: [a] -> [[a]] createPaths xs = Prelude.map (flip Prelude.take xs) [1..length xs] @@ -1485,6 +1494,18 @@ sanityParseBreakChunksK jumps = it (show jumps) $ do lst <- Prelude.map A.toList <$> K.toList rest (val, concat lst) `shouldBe` (expectedResult jumps tape) +sanityParseMany :: [Move] -> SpecWith () +sanityParseMany jumps = it (show jumps) $ do + res <- S.toList $ SI.parseMany (jumpParser jumps) $ S.fromList tape + res `shouldBe` (expectedResultMany jumps tape) + +sanityParseIterate :: [Move] -> SpecWith () +sanityParseIterate jumps = it (show jumps) $ do + res <- + S.toList + $ SI.parseIterate (const (jumpParser jumps)) [] $ S.fromList tape + res `shouldBe` (expectedResultMany jumps tape) + ------------------------------------------------------------------------------- -- Main ------------------------------------------------------------------------------- @@ -1501,6 +1522,8 @@ main = parserSanityTests "Stream.parseBreak" sanityParseBreak parserSanityTests "StreamK.parseDBreak" sanityParseDBreak parserSanityTests "A.sanityParseBreakChunksK" sanityParseBreakChunksK + parserSanityTests "Stream.parseMany" sanityParseMany + parserSanityTests "Stream.parseIterate" sanityParseIterate describe "Instances" $ do prop "applicative" applicative prop "Alternative: end of input 1" altEOF1