Skip to content

Commit

Permalink
test on Reshaped and Sub arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
Glenn Moynihan committed Jul 1, 2021
1 parent bd8d4f9 commit cdb209a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using AxisArrays
using AxisKeys
using Base: ReshapedArray
using DataFrames: DataFrame
using Dates
using Documenter: doctest
Expand Down
9 changes: 7 additions & 2 deletions test/types/matrix.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
@testset "matrix" begin
# Want to test that certain subtypes of arrays are compatible
_make_matrix(::Type{Matrix}) = [1 2 3; 4 5 6]
_make_matrix(::Type{SubArray}) = view([1 2 3; 4 5 6], :, :)
_make_matrix(::Type{ReshapedArray}) = reshape([1 2 3; 4 5 6], 2, 3)

x = [1 2 3; 4 5 6]
@testset "$MatrixType" for MatrixType in (Matrix, SubArray, ReshapedArray)

x = _make_matrix(MatrixType)

@test is_transformable(x)

Expand Down

0 comments on commit cdb209a

Please sign in to comment.