mirror of
https://github.com/typeable/file-embed.git
synced 2024-08-15 10:40:30 +03:00
updated for '\r'
This commit is contained in:
parent
752a2b80a6
commit
65cc8e5e90
@ -2,7 +2,7 @@
|
|||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
|
||||||
import Control.Monad (unless)
|
import Control.Monad (unless)
|
||||||
import qualified Data.ByteString as B (ByteString)
|
import qualified Data.ByteString as B (ByteString, filter)
|
||||||
import Data.FileEmbed
|
import Data.FileEmbed
|
||||||
import System.FilePath ((</>))
|
import System.FilePath ((</>))
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ main = do
|
|||||||
filter (/= '\r') str @?= "foo\n"
|
filter (/= '\r') str @?= "foo\n"
|
||||||
|
|
||||||
let mbs = $(embedFileIfExists "test/sample/foo")
|
let mbs = $(embedFileIfExists "test/sample/foo")
|
||||||
mbs @?= Just "foo\r\n"
|
fmap (B.filter (/= fromIntegral (fromEnum '\r'))) mbs @?= Just "foo\n"
|
||||||
|
|
||||||
let mbs2 = $(embedFileIfExists "test/sample/foo2") :: Maybe B.ByteString
|
let mbs2 = $(embedFileIfExists "test/sample/foo2") :: Maybe B.ByteString
|
||||||
mbs2 @?= Nothing
|
mbs2 @?= Nothing
|
||||||
|
Loading…
Reference in New Issue
Block a user