Closed jaseemabid closed 9 years ago
ok we can start with tasty. Can you commit a set of initial files required for this. Also I think we should pick some basic test-cases from the existing torrent test-suite. Here is a link to libtorrent's test-suite
I just realised that we are already creating test-cases from libtorrent
Are we?
well the doctests are taken from https://github.com/libtorrent/libtorrent/blob/master/test/test_bencoding.cpp
I'm not a fan of doctest. Its just cleaner to write good unit tests and run it regularly.
I took the tests from the specification wiki.
@vu3rdd @dfordivam Before we close this, do we want doctest at all? I think its just easier and cleaner to maintain simple plain old unit tests. Otherwise, I have to find a way to integrate doctests with tasty so that they are also run on travis.
@vu3rdd Can you enable https://travis-ci.org/vu3rdd/functorrent? You will have to login with your github account. The tests should then run on every commit as well as pull request.
Doctests seems to be broken anyway.
$ .cabal-sandbox/bin/doctest src/FuncTorrent/Bencode.hs
### Failure in src/FuncTorrent/Bencode.hs:76: expression `parse bencList "Blist" (pack "l4:spam4:eggse")'
expected: Right ["spam","eggs"]
but got: Right [Bstr "spam",Bstr "eggs"]
### Failure in src/FuncTorrent/Bencode.hs:90: expression `parse bencDict "Bdict" (pack "d3:cow3:moo4:spam4:eggse")'
expected: Right (fromList [("cow","moo"),("spam","eggs")])
but got: Right (fromList [(Bstr "cow",Bstr "moo"),(Bstr "spam",Bstr "eggs")])
Examples: 27 Tried: 23 Errors: 0 Failures: 2
Managed to add some tests to my own lisper, will try to do some same for functorrent next weekend or so.
Hunit is a mess, and had a really bad time with it. It would always report a success and count to be 1. Thankfully Tasty feels really good. Got the whole thing hooked up with travis-ci so the builds are available publicly[2].
See the last few commits[1] for details. One of the main things to do was to split the project into a library and an executable.
Give it a try!