Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix show test on nightly #49

Merged
merged 1 commit into from
Aug 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ using SimpleTraits, Unitful
@traitfn has_time_axis(::AA) where {AA<:AxisArray; HasTimeAxis{AA}} = true
@traitfn has_time_axis(::AA) where {AA<:AxisArray; !HasTimeAxis{AA}} = false

function typestring(::Type{T}) where T # from https://github.com/JuliaImages/ImageCore.jl/pull/133
buf = IOBuffer()
show(buf, T)
String(take!(buf))
end

@testset "no units, no time" begin
A = AxisArray(reshape(1:12, 3, 4), Axis{:x}(1:3), Axis{:y}(1:4))
@test @inferred(timeaxis(A)) === nothing
Expand Down Expand Up @@ -91,7 +97,7 @@ end

@testset "grayscale" begin
A = AxisArray(rand(Gray{N0f8}, 4, 5), :y, :x)
@test summary(A) == "2-dimensional AxisArray{Gray{N0f8},2,...} with axes:\n :y, Base.OneTo(4)\n :x, Base.OneTo(5)\nAnd data, a 4×5 Array{Gray{N0f8},2} with eltype Gray{Normed{UInt8,8}}"
@test summary(A) == "2-dimensional AxisArray{Gray{N0f8},2,...} with axes:\n :y, Base.OneTo(4)\n :x, Base.OneTo(5)\nAnd data, a 4×5 Array{Gray{N0f8},2} with eltype Gray{$(typestring(N0f8))}"
cv = channelview(A)
@test AxisArrays.axes(cv) == (Axis{:y}(1:4), Axis{:x}(1:5))
@test spatialorder(cv) == (:y, :x)
Expand Down