Tests: Not many tests checking inputs

Issue #15 new
Andy Nowacki created an issue

There are few tests of how the code handles different inputs, both expected and unexpected (see https://bitbucket.org/clhaley/multitaper.jl/issues/14/code-multispec-input-vector-eltype). I strongly urge you to add more.

Comments (2)

  1. Charlotte Haley repo owner

    To clarify, by test here you mean throw an error when the function is given incompatible inputs?

  2. Andy Nowacki reporter

    No, I do mean actual tests, with the idea being that a test should only pass if the function responds to the ‘wrong’ input the correct way. But this may not be needed very much after your changes so far—I have yet to look in detail.


    An example might be for a function which cannot take negative numbers:

    f(x) = "nonnegative"
    

    I would usually want to have a test which ensured it did the right thing rather than returning the wrong output.

    @test_throws ArgumentError f(-1)
    

    One can then modify the function to make sure this holds.

  3. Log in to comment