From 0863b30f6903961ade0ca868f23ce78fd3839b3b Mon Sep 17 00:00:00 2001 From: Sascha Mann Date: Tue, 19 Mar 2019 14:58:43 +0100 Subject: [PATCH] difference-of-squares: Test that result is Integer (fixes #138) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This ensures that a solution using Gauss's formula uses `รท` and not `/`. --- exercises/difference-of-squares/runtests.jl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/exercises/difference-of-squares/runtests.jl b/exercises/difference-of-squares/runtests.jl index 7e98107323e45..63427d1d1fdce 100644 --- a/exercises/difference-of-squares/runtests.jl +++ b/exercises/difference-of-squares/runtests.jl @@ -3,20 +3,20 @@ using Test include("difference-of-squares.jl") @testset "Square the sum of the numbers up to the given number" begin - @test square_of_sum(5) == 225 - @test square_of_sum(10) == 3025 - @test square_of_sum(100) == 25502500 + @test square_of_sum(5)::Integer == 225 + @test square_of_sum(10)::Integer == 3025 + @test square_of_sum(100)::Integer == 25502500 end @testset "Sum the squares of the numbers up to the given number" begin - @test sum_of_squares(5) == 55 - @test sum_of_squares(10) == 385 - @test sum_of_squares(100) == 338350 + @test sum_of_squares(5)::Integer == 55 + @test sum_of_squares(10)::Integer == 385 + @test sum_of_squares(100)::Integer == 338350 end @testset "Subtract sum of squares from square of sums" begin - @test difference(0) == 0 - @test difference(5) == 170 - @test difference(10) == 2640 - @test difference(100) == 25164150 + @test difference(0)::Integer == 0 + @test difference(5)::Integer == 170 + @test difference(10)::Integer == 2640 + @test difference(100)::Integer == 25164150 end