krestenkrab / triq

Trifork QuickCheck
http://krestenkrab.github.com/triq/
Apache License 2.0
281 stars 54 forks source link

Crash error hides generated input #36

Closed essen closed 9 years ago

essen commented 9 years ago

Hello,

when the property crashes, we end up with an output similar to this:

Testing cow_http_hd:prop_parse_content_type/0
.....Failed with: {error,badarg,
                    [{cow_http_hd,unquote,2,
                                  [{file,"src/cow_http_hd.erl"},{line,733}]},
                     {cow_http_hd,'-prop_parse_content_type/0-lc$^1/1-1-',1,
                                  [{file,"src/cow_http_hd.erl"},{line,742}]},
                     {cow_http_hd,'-prop_parse_content_type/0-lc$^1/1-1-',1,
                                  [{file,"src/cow_http_hd.erl"},{line,742}]},
                     {cow_http_hd,'-prop_parse_content_type/0-fun-0-',1,
                                  [{file,"src/cow_http_hd.erl"},{line,742}]},
                     {triq,check_input,4,[{file,"src/triq.erl"},{line,83}]},
                     {triq,check_forall,6,[{file,"src/triq.erl"},{line,250}]},
                     {triq,check,3,[{file,"src/triq.erl"},{line,331}]},
                     {triq,all,2,[{file,"src/triq.erl"},{line,269}]}]}

Failed after 6 tests with {'EXIT',badarg}

As you can see it's not so useful, in particular because Erlang hid the arguments here. So I have no way of knowing what the input was and how to reproduce.

I would like to send a proper fix for this, but in the meantime I added an io:format in the right place. Please advise on what you would like the fix to look like.

essen commented 9 years ago

Though I suppose I have this issue only because of the shrinker issues I ran into. I'll close this one then.