]> git.rkrishnan.org Git - functorrent.git/blobdiff - test/Test.hs
WIP: split tests into their own modules
[functorrent.git] / test / Test.hs
index 77a8d72de8147c32af55e1702ee4e1e6adcd299a..9915d977133dde2d0f23dbcd3bfa67361db2130a 100644 (file)
@@ -8,13 +8,14 @@ import Data.Map.Strict (fromList)
 
 import Test.Tasty (TestTree, testGroup, defaultMain)
 import Test.Tasty.HUnit (testCase, (@?=))
-import Test.Tasty.QuickCheck (testProperty)
 
 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,16 +94,8 @@ unitTests :: TestTree
 unitTests = testGroup "Unit tests" [testFile, testMkMetaInfo, testResponse1,
                                             testResponse2]
 
-propEncodeDecode :: BVal -> Bool
-propEncodeDecode bval = let encoded = encode bval
-                            decoded = decode encoded
-                        in Right bval == decoded
-
-qcTests :: TestTree
-qcTests = testGroup "QuickCheck tests" [ testProperty "encode/decode" propEncodeDecode ]
-
 tests :: TestTree
-tests = testGroup "Tests" [unitTests, qcTests]
+tests = testGroup "Tests" [unitTests, BencodeTests.tests]
 
 main :: IO ()
 main = defaultMain tests