Skip to content

Commit

Permalink
Added some missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brainandforce committed Oct 20, 2024
1 parent 4e89b66 commit fd93a9c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/ext/Unitful.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
xu = x*u"m"
yu = y*u"m"
@test xu yu === KVector{2,VGA(3)}(1, 0, 0) * u"m^2"
@test 2 xu === KVector{1,VGA(3)}(2, 0, 0) * u"m"
@test yu 2 === KVector{1,VGA(3)}(0, 2, 0) * u"m"
@test_throws Unitful.AffineError 2 2u"°F"
@test_throws Unitful.AffineError 2u"°F" 2
# Printing
@test Unitful.BracketStyle(x) === Unitful.RoundBrackets()
@test string(xu) == "(1e₁) m"
@test string(xu yu) == "(1e₁e₂) m^2"
unitless = Quantity{KVector{1,VGA(3),Int,3}, NoDims, Unitful.FreeUnits{(), NoDims, nothing}}(y)
@test string(unitless) == "1e₂ (no units)"
@test repr("text/plain", unitless) == string(unitless)
end

0 comments on commit fd93a9c

Please sign in to comment.