1 module BencodeTests (tests) where
3 import FuncTorrent.Bencode (encode, decode, BVal(..))
5 import Test.Tasty (TestTree, testGroup)
6 import Test.Tasty.QuickCheck (testProperty)
8 propEncodeDecode :: BVal -> Bool
9 propEncodeDecode bval = let encoded = encode bval
10 decoded = decode encoded
11 in Right bval == decoded
14 qcTests = testGroup "QuickCheck tests" [ testProperty "encode/decode" propEncodeDecode ]
17 tests = testGroup "Tests" [qcTests]