Skip to content

Commit c7f6a55

Browse files
Update runtests.jl
1 parent c6f6e57 commit c7f6a55

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

test/runtests.jl

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,40 @@
11
using IrrationalConstants
22
using Test
33

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π)
69
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

Comments
 (0)