Unit Testing: should I use Base.Test instead of FactCheck?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Unit Testing: should I use Base.Test instead of FactCheck?

Florian Oswald
I know there are many testing packages out there. I have been using FactCheck, but have seen it's been relegated to the JuliaArchive. I take that as a sign it's a good moment to use something else.

There is 1 thing I sorely miss from Base.Test coming from FactCheck, and that is the ability to say

@fact false --> true "your test failed: false is not true"

i.e. i can print a custom error message to be shown upon failure only.

I also think the display of test results (indentation of lower level "contexts" (@testsets in Base.Test)) is nicer in FactCheck, but that's not that important.

Thanks for any advice.


Reply | Threaded
Open this post in threaded view
|

Re: Unit Testing: should I use Base.Test instead of FactCheck?

Steven G. Johnson


On Friday, October 28, 2016 at 10:30:28 AM UTC-4, Florian Oswald wrote:
There is 1 thing I sorely miss from Base.Test coming from FactCheck, and that is the ability to say

@fact false --> true "your test failed: false is not true"

@test false || error("your test failed: false is not true.")
Reply | Threaded
Open this post in threaded view
|

Re: Unit Testing: should I use Base.Test instead of FactCheck?

Florian Oswald
D'oh.

Thanks!

On Saturday, 29 October 2016, Steven G. Johnson <[hidden email]> wrote:


On Friday, October 28, 2016 at 10:30:28 AM UTC-4, Florian Oswald wrote:
There is 1 thing I sorely miss from Base.Test coming from FactCheck, and that is the ability to say

@fact false --> true "your test failed: false is not true"

@test false || error("your test failed: false is not true.")
Reply | Threaded
Open this post in threaded view
|

Re: Unit Testing: should I use Base.Test instead of FactCheck?

Spencer Russell-4
In reply to this post by Florian Oswald
I generally have pretty granular `@testset`s, which can have messages attached that are printed on failure. That way I still get a description of what failed.

I think the lack of indentation for nested testsets is a regression that hit 0.5 (BaseTestNext on 0.4 indents nested testsets), and there’s currently an issue filed: https://github.com/JuliaLang/julia/issues/18611

so they should get re-prettified soon enough.

-s


On Fri, Oct 28, 2016, at 10:30 AM, Florian Oswald wrote:
I know there are many testing packages out there. I have been using FactCheck, but have seen it's been relegated to the JuliaArchive. I take that as a sign it's a good moment to use something else.

There is 1 thing I sorely miss from Base.Test coming from FactCheck, and that is the ability to say

@fact false --> true "your test failed: false is not true"

i.e. i can print a custom error message to be shown upon failure only.

I also think the display of test results (indentation of lower level "contexts" (@testsets in Base.Test)) is nicer in FactCheck, but that's not that important.

Thanks for any advice.



Reply | Threaded
Open this post in threaded view
|

Re: Unit Testing: should I use Base.Test instead of FactCheck?

Florian Oswald
Awesome. Thanks!


On Monday, 31 October 2016, Spencer Russell <[hidden email]> wrote:
I generally have pretty granular `@testset`s, which can have messages attached that are printed on failure. That way I still get a description of what failed.

I think the lack of indentation for nested testsets is a regression that hit 0.5 (BaseTestNext on 0.4 indents nested testsets), and there’s currently an issue filed: https://github.com/JuliaLang/julia/issues/18611

so they should get re-prettified soon enough.

-s


On Fri, Oct 28, 2016, at 10:30 AM, Florian Oswald wrote:
I know there are many testing packages out there. I have been using FactCheck, but have seen it's been relegated to the JuliaArchive. I take that as a sign it's a good moment to use something else.

There is 1 thing I sorely miss from Base.Test coming from FactCheck, and that is the ability to say

@fact false --> true "your test failed: false is not true"

i.e. i can print a custom error message to be shown upon failure only.

I also think the display of test results (indentation of lower level "contexts" (@testsets in Base.Test)) is nicer in FactCheck, but that's not that important.

Thanks for any advice.