Skip to content

Commit

Permalink
Same changes for U+025B/U+03B5
Browse files Browse the repository at this point in the history
  • Loading branch information
sostock committed Jan 3, 2022
1 parent 18378af commit 587d060
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/pkgdefaults.jl
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ const μ0 = 4π*(1//10)^7*H/m # exact (but gets promoted to Float64...),
\nA quantity representing the vacuum permittivity constant, defined as 1 / (μ0 × c^2).
\nDimension: 𝐈^2 𝐓^4 𝐋^-3 𝐌^-1.
\nSee also: [`Unitful.μ0`](@ref), [`Unitful.c`](@ref)."
const ɛ0 = 1/(μ0*c^2) # exact, electric constant; changes here may affect
@doc @doc(ɛ0) const ϵ0 = ɛ0 # test of issue 79.
const ε0 = 1/(μ0*c^2) # exact, electric constant; changes here may affect
@doc @doc(ε0) const ϵ0 = ε0 # test of issue 79.
" Unitful.Z0
\nA quantity representing the impedance of free space, a constant defined as μ0 × c.
\nDimension: 𝐋^2 𝐌 𝐈^-2 𝐓^-3.
Expand Down
7 changes: 6 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ end
@test uconvert(g, 1*FixedUnits(kg)) == 1000g # manual conversion okay
@test (1kg, 2g, 3mg, missing) .|> g === (1000g, 2g, (3//1000)g, missing)
# Issue 79:
@test isapprox(upreferred(Unitful.ɛ0), 8.85e-12u"F/m", atol=0.01e-12u"F/m")
@test isapprox(upreferred(Unitful.ε0), 8.85e-12u"F/m", atol=0.01e-12u"F/m")
# Issue 261:
@test 1u"rps" == 360°/s
@test 1u"rps" == 2π/s
Expand Down Expand Up @@ -1861,6 +1861,11 @@ end
@test uparse("µm") === uparse("μm")
@test uparse("dBµV") === uparse("dBμV")
@test @doc(Unitful.µm) == @doc(Unitful.μm)
# Julia treats ɛ (U+025B) and ε (U+03B5) as the same
@test Unitful.ɛ0 === Unitful.ε0
@test u"ɛ0" === u"ε0"
@test uparse("ɛ0") === uparse("ε0")
@test @doc(Unitful.ɛ0) == @doc(Unitful.ε0)
end

module DocUnits
Expand Down

0 comments on commit 587d060

Please sign in to comment.