Skip to content

Commit

Permalink
nofasta
Browse files Browse the repository at this point in the history
  • Loading branch information
maksbotan committed Dec 8, 2023
1 parent d8b62d6 commit 5c9bb16
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/FASTASpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Bio.FASTA.Parser (parseOnly)
import Bio.FASTA.Type (Fasta, FastaItem (..))
import Bio.Sequence (bareSequence)
import Control.Monad.IO.Class (liftIO)
import qualified Data.Text as T
import Data.Text.IO (readFile)
import Prelude hiding (readFile, writeFile)
import System.Directory (removeFile)
Expand Down Expand Up @@ -70,7 +71,7 @@ parseBadFile path cf =
it ("correctly parses bad fasta from file " <> path) $ do
res <- liftIO (readFile path)
let badRes = parseOnly fastaP res
badRes `shouldBe` cf
noTabs badRes `shouldBe` cf

writeFile :: FilePath -> Fasta Char -> Spec
writeFile path cf =
Expand All @@ -79,3 +80,6 @@ writeFile path cf =
fasta <- fromFile path
removeFile path
fasta `shouldBe` cf

noTabs :: String -> String
noTabs = T.unpack . T.replace "\t" " " . T.pack

0 comments on commit 5c9bb16

Please sign in to comment.