A little example

using Base.Test

function f(x)
    if x < 0
        warn("x should be non-negative")
    end
    return x
end

@test_warning f(-1)  #this is the test I am looking for



W dniu piątek, 20 czerwca 2014 14:27:55 UTC+2 użytkownik Paweł Biernat 
napisał:
>
> I would like to write a test case verifying that a function call results 
> in a warning.  I have seen that there are tests for exceptions, but I was 
> unable to find a test for warining in the docs.
>

Reply via email to