Skip to content

Commit

Permalink
Update runtests.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
depial authored Mar 27, 2024
1 parent 15fe3c6 commit c34638d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions exercises/practice/perfect-numbers/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ include("perfect-numbers.jl")
@testset "Large perfect number is classified correctly" begin
@test isperfect(33550336)
end

@testset "Correctly handles non-perfect numbers" begin
@test !isperfect(12)
@test !isperfect(4)
end
end

@testset "Abundant numbers" begin
Expand All @@ -30,6 +35,11 @@ end
@testset "Large abundant number is classified correctly" begin
@test isabundant(33550335)
end

@testset "Correctly handles non-abundant numbers" begin
@test !isabundant(6)
@test !isabundant(32)
end
end

@testset "Deficient numbers" begin
Expand All @@ -53,6 +63,11 @@ end
@testset "Edge case (no factors other than itself) is classified correctly" begin
@test isdeficient(1)
end

@testset "Correctly handles non-deficient numbers" begin
@test !isdeficient(28)
@test !isdeficient(30)
end
end

@testset "Invalid inputs" begin
Expand Down

0 comments on commit c34638d

Please sign in to comment.