Skip to content

Commit

Permalink
Add tests for utils
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeingold committed Oct 8, 2024
1 parent b96dbf5 commit d633954
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[deps]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Meshes = "eacbb407-ea5a-433e-ab97-5258b1ca43fa"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
Expand All @@ -12,6 +13,7 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
[compat]
Aqua = "0.7, 0.8"
ExplicitImports = "1.6.0"
LinearAlgebra = "1"
Meshes = "0.50, 0.51"
QuadGK = "2.1.1"
SpecialFunctions = "2"
Expand Down
17 changes: 17 additions & 0 deletions test/utils.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@testitem "Utilities" setup=[Setup] begin
using LinearAlgebra: norm

# _kvector
v = Meshes.Vec(3, 4)
@test norm(MeshIntegrals._kvector(v)) 5.0

# _ukvector
v = Meshes.Vec(3, 4)
(units, kvector) = MeshIntegrals._ukvector(v)
@test units == u"m"
@test norm(kvector) 5.0

# _units
p = Point(1.0u"cm", 2.0u"mm", 3.0u"m")
@test MeshIntegrals._units(p) == u"m"
end

0 comments on commit d633954

Please sign in to comment.