Skip to content

Commit

Permalink
add more tests on quat
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrodium committed Nov 25, 2023
1 parent 8f4c091 commit a572a1f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/Quaternion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ end
@test quat(Quaternion(1, 2, 3, 4)) === Quaternion(1, 2, 3, 4)
@test quat([2, 3, 4]) == Quaternion{Int}[2, 3, 4]
@test_throws ErrorException quat(Real[1,2,3])
@test quat(Quaternion[1,2]) == Quaternion[1,2]

@test quat(Int) === Quaternion{Int}
@test quat(Float32) === Quaternion{Float32}

# Note that `quat(1,missing,0,0)` throws an error.
# This is the same behavior as `complex(1,missing)`.
@test quat(missing) === missing
@test quat(Missing) === Missing
@test quat(Union{Missing, Int}) === Union{Missing, Quaternion{Int}}
end

@testset "random generation" begin
Expand Down

0 comments on commit a572a1f

Please sign in to comment.