Some solutions for the julia path
This commit is contained in:
15
julia/collatz-conjecture/runtests.jl
Normal file
15
julia/collatz-conjecture/runtests.jl
Normal file
@@ -0,0 +1,15 @@
|
||||
using Test
|
||||
|
||||
include("collatz-conjecture.jl")
|
||||
|
||||
@testset verbose = true "tests" begin
|
||||
# canonical data
|
||||
@testset "Canonical data" begin
|
||||
@test collatz_steps(1) == 0
|
||||
@test collatz_steps(16) == 4
|
||||
@test collatz_steps(12) == 9
|
||||
@test collatz_steps(1000000) == 152
|
||||
@test_throws DomainError collatz_steps(0)
|
||||
@test_throws DomainError collatz_steps(-15)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user