JuliaImages / ImageDraw.jl

Drawing Package for JuliaImages
Other
27 stars 17 forks source link

Fix for v0.7/1.0 #21

Closed ghost closed 6 years ago

ghost commented 6 years ago

indices -> axes

ghost commented 6 years ago

I'm trying to update test cases, but cannot resolve following errors. Error messages said return type Bool does not match inferred return type Union{Missing, Bool}.

LineNormal: Error During Test at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:160
  Test threw exception
  Expression: #= /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:160 =# @inferred draw(img, LineNormal(1, 0)) == expected
  return type Bool does not match inferred return type Union{Missing, Bool}
  Stacktrace:
   [1] error(::String) at ./error.jl:33
   [2] macro expansion at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:16 [inlined]
   [3] macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1083 [inlined]
   [4] macro expansion at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:4 [inlined]
   [5] macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1083 [inlined]
   [6] top-level scope at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:3
LineNormal: Error During Test at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:162
  Test threw exception
  Expression: #= /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:162 =# @inferred draw(img, LineNormal(1, 0), Gray(0.5)) == expected
  return type Bool does not match inferred return type Union{Missing, Bool}
  Stacktrace:
   [1] error(::String) at ./error.jl:33
   [2] macro expansion at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:18 [inlined]
   [3] macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1083 [inlined]
   [4] macro expansion at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:4 [inlined]
   [5] macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1083 [inlined]
   [6] top-level scope at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:3
LineNormal: Error During Test at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:174
  Test threw exception
  Expression: #= /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:174 =# @inferred draw(img, LineNormal(7.5, π / 4)) == expected
  return type Bool does not match inferred return type Union{Missing, Bool}
  Stacktrace:
   [1] error(::String) at ./error.jl:33
   [2] macro expansion at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:29 [inlined]
   [3] macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1083 [inlined]
   [4] macro expansion at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:4 [inlined]
   [5] macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1083 [inlined]
   [6] top-level scope at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:3
LineNormal: Error During Test at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:182
  Test threw exception
  Expression: #= /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:182 =# @inferred draw(img, LineNormal((0, -π / 4)), Gray(0.8)) == expected
  return type Bool does not match inferred return type Union{Missing, Bool}
  Stacktrace:
   [1] error(::String) at ./error.jl:33
   [2] top-level scope at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1093
   [3] include at ./boot.jl:317 [inlined]
   [4] include_relative(::Module, ::String) at ./loading.jl:1038
   [5] include at ./sysimg.jl:29 [inlined]
   [6] include(::String) at /Users/daisuke/GitHub/ImageDraw.jl/test/runtests.jl:1
   [7] macro expansion at /Users/daisuke/GitHub/ImageDraw.jl/test/runtests.jl:16 [inlined]
   [8] macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1083 [inlined]
   [9] top-level scope at /Users/daisuke/GitHub/ImageDraw.jl/test/runtests.jl:16 [inlined]
   [10] top-level scope at ./none:0
LineNormal: Error During Test at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:185
  Test threw exception
  Expression: #= /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:185 =# @inferred draw(img, LineNormal(4, 0)) == expected
  return type Bool does not match inferred return type Union{Missing, Bool}
  Stacktrace:
   [1] error(::String) at ./error.jl:33
   [2] macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1070 [inlined]
   [3] macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1071 [inlined]
   [4] macro expansion at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:4 [inlined]
   [5] macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1083 [inlined]
   [6] top-level scope at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:3
LineNormal: Error During Test at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:186
  Test threw exception
  Expression: #= /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:186 =# @inferred draw(img, LineNormal(4, π / 2)) == expected
  return type Bool does not match inferred return type Union{Missing, Bool}
  Stacktrace:
   [1] error(::String) at ./error.jl:33
   [2] macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1071 [inlined] (repeats 2 times)
   [3] macro expansion at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:4 [inlined]
   [4] macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1083 [inlined]
   [5] top-level scope at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:3
LineNormal: Error During Test at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:187
  Test threw exception
  Expression: #= /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:187 =# @inferred draw(img, LineNormal(5, π / 4)) == expected
  return type Bool does not match inferred return type Union{Missing, Bool}
  Stacktrace:
   [1] error(::String) at ./error.jl:33
   [2] macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1074 [inlined]
   [3] macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1071 [inlined]
   [4] macro expansion at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:4 [inlined]
   [5] macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1083 [inlined]
   [6] top-level scope at /Users/daisuke/GitHub/ImageDraw.jl/test/line2d.jl:3
timholy commented 6 years ago

Thanks for tackling this!

Those errors are likely due to parsing changes or changes in operator precedence; just try changing @inferred expr into @inferred(expr) (i.e., use parentheses to delimit the scope of the @inferred macro).

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 095869ead46a0e05e85c23ac9f695d9dfc373e50 on Dsuke-K:master into 2c38a2bb773204109ec1fa2c047ccc21314aa11c on JuliaImages:master.

timholy commented 6 years ago

For the appveyor failures, you can likely just replace the current file with the one in the README.