hscdio-0.1.0.0: test/Test/Libcdio/Upstream/Foreign/Nrg.hs
{-|
Description:
Copyright: (c) 2019-2020 Sam May
License: GPL-3.0-or-later
Maintainer: ag@eitilt.life
Stability: experimental
Portability: portable
-}
module Test.Libcdio.Upstream.Foreign.Nrg
( tests
, goodNrg
) where
import qualified Test.HUnit as U
import Test.HUnit ( (@=?), (~:) )
import Foreign.Libcdio.CdText
import Foreign.Libcdio.Device
import Test.Libcdio.Upstream.Foreign.Common
tests :: U.Test
tests = "Foreign.Libcdio.Test.Nrg" ~: U.TestList $ map open goodNrg
goodNrg :: [FilePath]
goodNrg
| haveDriver DriverNrg = ["p1.nrg"]
| otherwise = []
open :: FilePath -> U.Test
open f = "Nero images open the associated device correctly" ~: U.TestCase $ do
c <- cdioOpen (Just $ dataFile f) DriverUnknown
cdio <- case c of
Nothing -> U.assertFailure "Can't open the Nero file"
Just c' -> return c'
p <- cdTextGet cdio Performer Nothing
Just "Richard Stallman" @=? p
t <- cdTextGet cdio Title Nothing
Just "Join us now we have the software" @=? t
checkMmc cdio $ Just False
checkAccessMode cdio [Image]
checkSource cdio [dataFile f]