Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved tests: Added an ok in the end of the tests that use a helper function with asserts #43

Merged

Conversation

daha
Copy link
Contributor

@daha daha commented Oct 12, 2011

Hi Adam,

I made a minor improvement to a few tests by adding an ok at the end.

A failing test, run by foreach, does not show up in the stack trace if
it fails in it's last statement and that statement is a call to
another function where the asserts are. This is typically the case
for all the called_ tests. This can be helped by putting an ok in the
end. This change makes it easier to debug the tests with a helper
function, in the end, since it will tell the name of the test failing.

…sserts.

A failing test, run by foreach, does not show up in the stack trace if
it fails in it's last statement and that statement is a call to
another function where the asserts are.  This is typically the case
for all the called_ tests.  This can be helped by putting an ok in
the end.
@eproxus
Copy link
Owner

eproxus commented Oct 13, 2011

Thanks, I'll pull this for now.

There is another solution to this problem though, which I haven't had time to implement yet. It is to make all the funs in the foreach fully qualified funs (in this case, make them fun ?MODULE:some_test_/1 for example). That'll let EUnit detect the name of the function that it is running.

eproxus added a commit that referenced this pull request Oct 13, 2011
…r-functions2

Improved tests: Added an ok in the end of the tests that use a helper function with asserts
@eproxus eproxus merged commit 9cac337 into eproxus:master Oct 13, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants