How to test a function in Julia

oo92
Mon, 29 Mar 2021 22:56:54 +0000
New to Julia

Hi.

I have familiarity with unit testing in Python but I couldn’t really figure out how to do it in Julia when it comes to functions.

function year_created(p, language::String)
	loc = findfirst(p[:,2] .== language)
	return p[loc,1]
end

Based on some guides I’ve seen, I tried to add @test at the beginning of the function but it threw a Test.FallbackTestSetException("There was an error during testing"). I know that the way I did was amateur. I just don’t know what the steps are to test an entire function in Julia.

7 posts - 3 participants