From 4159d0c229e905964df0f09ebd8d57a056c08333 Mon Sep 17 00:00:00 2001 From: Brandon Flores Date: Sun, 20 Oct 2024 18:19:37 -0500 Subject: [PATCH] Added some missing tests --- test/ext/Unitful.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/ext/Unitful.jl b/test/ext/Unitful.jl index 736c85a..cb75648 100644 --- a/test/ext/Unitful.jl +++ b/test/ext/Unitful.jl @@ -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