redding / assert

Assertion style testing framework.
https://github.com/redding/assert
MIT License
10 stars 1 forks source link

properly determine a result trace line #132

Closed kellyredding closed 11 years ago

kellyredding commented 11 years ago

This updates the logic to prefer the first filtered backtrace line and then fallback to where the test was called from (in its context info). This properly sets the trace line for results not generated in a test code block (like macros or tests with no block).

This fixes a regression in 2538fc2008511b54d9bb35db2aff16ccc0a8a8c5 that caused the called from to be shown over the backtrace for all fail results.

The net effect of this new behavior is we expect filtered backtraces to be empty at times and that triggers the called from fallback. This greatly simplifies the filtering logic on the backtrace.

Finally, this adds the assert bin path to the filter out logic. Since the bin was introduced in v2.0.0, assert hasn't been filtering out assert lines in the backtrace. This properly fixes that.

@jcredding ready for review. nice that this ends up removing so much code.

jcredding commented 11 years ago

@kellyredding - Nice, didn't seem to hard to fix :boom: