1
0
mirror of https://gitlab.com/MisterBiggs/astro-helper.git synced 2025-06-16 15:17:20 +00:00
AstroHelper.jl/test/runtests.jl
2021-01-20 17:17:33 -07:00

12 lines
423 B
Julia

using AstroHelper
using Test
import AstroHelper: Quaternion
@testset "Quaternion Initialization" begin
@test Quaternion().r == 1.0
@test Quaternion([0,0,0,1]) == Quaternion(0, 0, 0, 1)
@test Quaternion([0 0 0], 0) == Quaternion(0, 0, 0, 1)
@test Quaternion([1 -2 2], (-2 * pi / 3)) Quaternion([-sqrt(3) / 6, sqrt(3) / 3, -sqrt(3) / 3, 1 / 2])
@test_throws ErrorException Quaternion(1, 2, 3, 4)
end