Initial upload

This commit is contained in:
2022-08-24 14:28:45 +02:00
parent c67653ddee
commit 57bc7b0289
370 changed files with 18479 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
include("prime-factors.jl")
using Test
@testset "no factors" begin
@test prime_factors(1) == []
end
@testset "prime number" begin
@test prime_factors(2) == [2]
end
@testset "square of a prime" begin
@test prime_factors(9) == [3, 3]
end
@testset "cube of a prime" begin
@test prime_factors(8) == [2, 2, 2]
end
@testset "product of primes and non-primes" begin
@test prime_factors(12) == [2, 2, 3]
end
@testset "product of primes" begin
@test prime_factors(901255) == [5, 17, 23, 461]
end
@testset "factors include a large prime" begin
@test prime_factors(93819012551) == [11, 9539, 894119]
end