|
1 | 1 | using IrrationalConstants
|
2 | 2 | using Test
|
3 | 3 |
|
4 |
| -@testset "IrrationalConstants.jl" begin |
5 |
| - # Write your tests here. |
| 4 | +@testset "k*pi" begin |
| 5 | + @test isapprox(2*pi, twoπ) |
| 6 | + @test isapprox(4*pi, fourπ) |
| 7 | + @test isapprox(pi/2, halfπ) |
| 8 | + @test isapprox(pi/4, quartπ) |
6 | 9 | end
|
| 10 | + |
| 11 | +@testset "k/pi" begin |
| 12 | + @test isapprox(1/pi, invπ) |
| 13 | + @test isapprox(2/pi, twoinvπ) |
| 14 | + @test isapprox(4/pi, fourinvπ) |
| 15 | +end |
| 16 | + |
| 17 | +@testset "1/(k*pi)" begin |
| 18 | + @test isapprox(1/(2pi), inv2π) |
| 19 | + @test isapprox(1/(4pi), inv4π) |
| 20 | +end |
| 21 | + |
| 22 | +@testset "sqrt" begin |
| 23 | + @test isapprox(sqrt(2), sqrt2) |
| 24 | + @test isapprox(sqrt(3), sqrt3) |
| 25 | + @test isapprox(sqrt(pi), sqrtπ) |
| 26 | + @test isapprox(sqrt(2pi), sqrt2π) |
| 27 | + @test isapprox(sqrt(4pi), sqrt4π) |
| 28 | + @test isapprox(sqrt(pi/2), sqrthalfπ) |
| 29 | + @test isapprox(sqrt(1/2), invsqrt2) |
| 30 | + @test isapprox(sqrt(1/(2pi)), invsqrt2π) |
| 31 | +end |
| 32 | + |
| 33 | +@testset "log" begin |
| 34 | + @test isapprox(log(1/2), loghalf) |
| 35 | + @test isapprox(log(2), logtwo) |
| 36 | + @test isapprox(log(pi), logπ) |
| 37 | + @test isapprox(log(2pi), log2π) |
| 38 | + @test isapprox(log(4pi), log4π) |
| 39 | +end |
| 40 | + |
0 commit comments