Skip to content

Commit fd7198c

Browse files
committed
tighter syntax?
1 parent 014ed32 commit fd7198c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

test/test_unitful.jl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,12 @@ end
294294
@test plot(y, label = P"meters") isa Plots.Plot
295295
end
296296

297-
if isdefined(Base, :get_extension)
298-
@testset "latexify as unitformat" begin
299-
y = rand(10) * u"m^-1"
300-
@test yguide(plot(y, ylabel = "hello", unitformat = latexify)) == "\$hello\\;\\left/\\;\\mathrm{m}^{-1}\\right.\$"
297+
isdefined(Base, :get_extension) && @testset "latexify as unitformat" begin
298+
y = rand(10) * u"m^-1"
299+
@test yguide(plot(y, ylabel = "hello", unitformat = latexify)) == "\$hello\\;\\left/\\;\\mathrm{m}^{-1}\\right.\$"
301300

302-
uf = (l, u) -> l * " (" * latexify(u) * ")"
303-
@test yguide(plot(y, ylabel = "hello", unitformat = uf)) == "hello (\$\\mathrm{m}^{-1}\$)"
304-
end
301+
uf = (l, u) -> l * " (" * latexify(u) * ")"
302+
@test yguide(plot(y, ylabel = "hello", unitformat = uf)) == "hello (\$\\mathrm{m}^{-1}\$)"
305303
end
306304

307305
@testset "colorbar title" begin

0 commit comments

Comments
 (0)