|
1 | 1 | module ApplyTests |
2 | 2 |
|
3 | | -using LazyArrays, FillArrays, ArrayLayouts, Test |
4 | | -import LazyArrays: materialize, broadcasted, DefaultApplyStyle, Applied, arguments, |
5 | | - ApplyArray, ApplyMatrix, ApplyVector, LazyArrayApplyStyle, ApplyLayout, call |
6 | | -import ArrayLayouts: StridedLayout |
7 | | -using LinearAlgebra |
| 3 | + using LazyArrays, FillArrays, ArrayLayouts, Test |
| 4 | + import LazyArrays: materialize, broadcasted, DefaultApplyStyle, Applied, arguments, |
| 5 | + ApplyArray, ApplyMatrix, ApplyVector, LazyArrayApplyStyle, ApplyLayout, call, |
| 6 | + CachedArrayStyle, CachedArray, LazyArrayStyle |
| 7 | + import ArrayLayouts: StridedLayout |
| 8 | + import Base.Broadcast: BroadcastStyle |
| 9 | + using LinearAlgebra |
8 | 10 |
|
9 | 11 | @testset "Applying" begin |
10 | 12 | @testset "Applied" begin |
@@ -121,6 +123,13 @@ using LinearAlgebra |
121 | 123 | end |
122 | 124 | @test colsupport(M,1) == 1:5 |
123 | 125 | end |
| 126 | + |
| 127 | + @testset "BroadcastStyle with a cached argument" begin |
| 128 | + A = ApplyArray(*, rand(10, 2), rand(2, 2)) |
| 129 | + @test BroadcastStyle(typeof(A)) == BroadcastStyle(typeof(A')) == BroadcastStyle(typeof(view(A, 1:2, 1:2))) == LazyArrayStyle{2}() |
| 130 | + A = ApplyArray(*, CachedArray(rand(10, 2)), rand(2, 2)) |
| 131 | + @test BroadcastStyle(typeof(A)) == BroadcastStyle(typeof(A')) == BroadcastStyle(typeof(view(A, 1:2, 1:2))) == CachedArrayStyle{2}() |
| 132 | + end |
124 | 133 | end # testset |
125 | 134 |
|
126 | 135 | end # module |
0 commit comments