Skip to content

Commit 2f491e8

Browse files
authored
Merge pull request #19 from blegat/icon
Fix test for find_icon
2 parents fdbd25a + d8d8216 commit 2f491e8

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

test/runtests.jl

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,13 @@ end
5050

5151
path = joinpath(@__DIR__, "designs");
5252

53-
fixed_volume_icon_ans =
54-
raw"icons\ModelingToolkitStandardLibrary\Hydraulic\IsothermalCompressible\FixedVolume.png"
55-
fixed_volume_icon_ans = abspath(fixed_volume_icon_ans)
56-
fixed_volume_icon_ans = normpath(fixed_volume_icon_ans)
57-
fixed_volume_icon_ans = lowercase(fixed_volume_icon_ans)
58-
53+
fixed_volume_icon_ans = joinpath(dirname(@__DIR__), "icons", "ModelingToolkitStandardLibrary", "Hydraulic", "IsothermalCompressible", "FixedVolume.png")
5954
fixed_volume_icon = ModelingToolkitDesigner.find_icon(sys.vol, path)
60-
fixed_volume_icon = abspath(fixed_volume_icon)
61-
fixed_volume_icon = normpath(fixed_volume_icon)
62-
fixed_volume_icon = lowercase(fixed_volume_icon)
63-
64-
#TODO: How can I make this work? normpath is not doing what I think it should
65-
# @test fixed_volume_icon == fixed_volume_icon_ans
55+
@test fixed_volume_icon == fixed_volume_icon_ans
6656

6757

6858
design = ODESystemDesign(sys, path);
6959
@test design.components[2].xy[] == (0.58, 0.0)
70-
@test lowercase(abspath(design.components[3].icon)) == fixed_volume_icon
60+
@test abspath(design.components[3].icon) == fixed_volume_icon
7161
@test_nowarn ModelingToolkitDesigner.view(design)
7262
@test_nowarn ModelingToolkitDesigner.view(design, false)
73-
74-

0 commit comments

Comments
 (0)