Closed froozen closed 8 years ago
Nice!
test/Main.hs
:
tests = testGroup "Network.Ricochet.Testing" [ cryptoTests, generalTests ]
Not sure about the spacing style...
test/Main.hs
:
QC.testProperty "base64check: en- and decoding works" base64Check
, QC.testProperty "signCheck: signing and verifying works" signCheck
, QC.testProperty "rawSignCheck: raw signing and verifying works" rawSignCheck
The descriptions could be a bit better here. I.e. you could mention the prism laws for base64check (Isn’t there some tasty module for testing lenses etc.?), and write something like verifying random signatures fails
and verifying correct signatures succeeds
(I’d propose splitting signCheck
into these two.) Same with rawSignCheck
.
I don't think splitting up the signature checks would be a good idea, as generating 100 RSA keys takes about 3 seconds and splitting those checks would mean we'd have to do that four times, making the total run-time of those tests go up to about 13 seconds. Tests that take so long are hardly useful.
I think we should write our own lens tests, as the tasty-lens seems to have taken the approach of enumerating the examples the lenses should be tested on, whereas I believe that we should generate them randomly using QuickCheck
.
I'll do that right now.
Would withResource
help us build a solution for the RSA keys problem? I think
we could create a resource which essentially is a pool of RSA keys that will be
used for the tests. A Chan
with two reading cursors, one for each of the two
quickcheck properties, might work.
I implemented that and a fix for 5c09c7a on the tests-sm
branch. We should
revisit the pool stuff after the congress, since its kinda like bikeshedding.
Feel free to cherry-pick commits from tests-sm
into this PR in case you agree
with them.
I meant 5c0fc7a. That fix adds 30 seconds to the runtime of the tests though, which I assume makes you unhappy. Do you know of any Tasty way to organize the tests into two groups, and running one of the two only if specified via command line options?
I think I implemented all tests that make sense to exist right now. Did I forget anything? Do you have any more ideas for test cases?