Skip to content

Commit 0538b08

Browse files
committed
Update the test suite to use the latest APIs
1 parent 62fbef0 commit 0538b08

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/Main.hs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ import Test.QuickCheck.Instances.Text ()
1010
import System.IO (hClose)
1111
import Data.Functor.Identity (Identity(..))
1212

13-
import qualified Streamly.Internal.Data.Array as Array (castUnsafe)
13+
import qualified Streamly.Internal.Data.Array as Array (unsafeCast)
1414

1515
import qualified Data.Text as BS
1616
import qualified Data.Text.Lazy as BSL
17-
import qualified Streamly.FileSystem.File as File
17+
import qualified Streamly.FileSystem.FileIO as File
18+
import qualified Streamly.FileSystem.Path as Path
1819
import qualified Streamly.Compat.Text as Strict
1920
import qualified Streamly.Compat.Text.Lazy as Lazy
2021
import qualified Streamly.Data.Stream as Stream
@@ -55,11 +56,12 @@ writeRead :: Int -> IO ()
5556
writeRead n = do
5657
str <- sequence $ replicate n (randomIO :: IO Char)
5758
let txt = BSL.pack str
58-
withSystemTempFile "temp" $ \fp hdl -> do
59+
withSystemTempFile "temp" $ \fp0 hdl -> do
60+
fp <- Path.fromString fp0
5961
hClose hdl
60-
let strm = fmap Array.castUnsafe $ Lazy.toChunks txt
62+
let strm = fmap Array.unsafeCast $ Lazy.toChunks txt
6163
Stream.fold (File.writeChunks fp) strm
62-
let strm1 = fmap Array.castUnsafe $ File.readChunks fp
64+
let strm1 = fmap Array.unsafeCast $ File.readChunks fp
6365
txt1 <- Lazy.unsafeFromChunksIO strm1
6466
txt1 `shouldBe` txt
6567

0 commit comments

Comments
 (0)