Hs-Source-Dirs: src
GHC-Options: -Wall
Build-Depends: base, ofc
+
+Test-Suite ofc-tests
+ Type: exitcode-stdio-1.0
+ Hs-Source-Dirs: tests
+ GHC-Options: -Wall
+ Main-Is: Main.hs
+ Build-Depends: base, HUnit, ofc
--- /dev/null
+module Main where
+
+import System.Exit (exitFailure, exitSuccess)
+import Test.HUnit
+
+import qualified Tests.Spectral (tests)
+
+main :: IO ()
+main = do
+ results <- runTestTT tests
+ if (errors results + failures results) > 0
+ then exitFailure
+ else exitSuccess
+
+tests :: Test
+tests = TestList
+ [ TestLabel "Spectral" Tests.Spectral.tests
+ ]
--- /dev/null
+module Tests.Spectral (tests) where
+
+import Test.HUnit
+
+import OFC.Spectral
+
+tests :: Test
+tests = TestList
+ [ TestCase negateNullBand
+ ]
+
+negateNullBand :: Assertion
+negateNullBand = (isNullBand $ negateBand nullBand) @?
+ "Negating the null band produced a non-null band."