Skip to content

Commit 52a83c8

Browse files
el-osojvieyras
andauthoredNov 19, 2020
Small bug fix on unit test. Test assumed that output was an integer whereas it could be any number. Changed to match floats and parse floats (#507)
Co-authored-by: Jorge Alberto Vieyra Salas <[email protected]>
1 parent 7a36db6 commit 52a83c8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎test/runtests.jl

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ end
2121
# with Matplotlib 1.3, I get "UserWarning: bbox_inches option for ps backend is not implemented yet"
2222
if PyPlot.version >= v"2"
2323
s = sprint(show, "application/postscript", fig);
24-
m = match(r"%%BoundingBox: *([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+)", s)
24+
# m = match(r"%%BoundingBox: *([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+)", s)
25+
m = match(r"%%BoundingBox: *([0-9]+\.?[0-9]*) +([0-9]+\.?[0-9]*) +([0-9]+\.?[0-9]*) +([0-9]+\.?[0-9]*)", s)
2526
@test m !== nothing
26-
boundingbox = map(s -> parse(Int, s), m.captures)
27+
boundingbox = map(s -> parse(Float64, s), m.captures)
2728
@info("got plot bounding box ", boundingbox)
2829
@test all([300, 200] .< boundingbox[3:4] - boundingbox[1:2] .< [450,350])
2930
end

0 commit comments

Comments
 (0)
Please sign in to comment.