]> git.rkrishnan.org Git - functorrent.git/blobdiff - test/Test.hs
WIP: split tests into their own modules
[functorrent.git] / test / Test.hs
index b0be736950df6b4dfde6be30d43b1ab7e69a261b..9915d977133dde2d0f23dbcd3bfa67361db2130a 100644 (file)
@@ -6,14 +6,16 @@ import Prelude hiding (readFile)
 import Data.ByteString (ByteString, readFile)
 import Data.Map.Strict (fromList)
 
-import Test.Tasty
-import Test.Tasty.HUnit
+import Test.Tasty (TestTree, testGroup, defaultMain)
+import Test.Tasty.HUnit (testCase, (@?=))
 
-import FuncTorrent.Bencode (decode, BVal(..))
+import FuncTorrent.Bencode (encode, decode, BVal(..))
 import FuncTorrent.Metainfo (Info(..), Metainfo(..), mkMetaInfo)
 import FuncTorrent.Peer (Peer(..))
 import FuncTorrent.Tracker
 
+import qualified BencodeTests
+
 -- Parsed .torrent file
 file :: BVal
 file = Bdict (fromList [
@@ -93,7 +95,7 @@ unitTests = testGroup "Unit tests" [testFile, testMkMetaInfo, testResponse1,
                                             testResponse2]
 
 tests :: TestTree
-tests = testGroup "Tests" [unitTests]
+tests = testGroup "Tests" [unitTests, BencodeTests.tests]
 
 main :: IO ()
 main = defaultMain tests