|
5 | 5 | @test AxisArray(x, replicate_pad(first_pad=3, last_pad=3)) == [:a, :a, :a, :a, :b, :c, :d, :e, :e, :e, :e] |
6 | 6 | @test AxisArray(x, symmetric_pad(first_pad=3, last_pad=3)) == [:d, :c, :b, :a, :b, :c, :d, :e, :d, :c, :b] |
7 | 7 | @test AxisArray(x, reflect_pad(first_pad=3, last_pad=3)) == [:c, :b, :a, :a, :b, :c, :d, :e, :e, :d, :c] |
8 | | - @test AxisArray(1:2, zero_pad(sym_pad=2)) == [0, 0, 1, 2, 0, 0] |
9 | 8 | @test AxisArray(1:2, one_pad(sym_pad=2)) == [1, 1, 1, 2, 1, 1] |
| 9 | + @test AxisArray(1:2, zero_pad(sym_pad=2)) == [0, 0, 1, 2, 0, 0] |
10 | 10 |
|
11 | 11 | x = reshape(1:6, 3, 2) |
12 | 12 | ax = @inferred(AxisArray(x, replicate_pad(sym_pad=2), replicate_pad(sym_pad=2))) |
|
18 | 18 | @test axes(cax, 1) isa OffsetAxis |
19 | 19 | @test @inferred(IndexStyle(ax)) isa IndexCartesian |
20 | 20 |
|
| 21 | + axis = zero_pad(SimpleAxis(ArrayInterface.StaticInt(2)); sym_pad=ArrayInterface.StaticInt(2)) |
| 22 | + @test ArrayInterface.known_first(axis) === -1 |
| 23 | + @test ArrayInterface.known_last(axis) === 4 |
| 24 | + @test ArrayInterface.known_length(axis) === 6 |
| 25 | + |
| 26 | + axis = zero_pad(1:2, sym_pad=2) |
| 27 | + @test ArrayInterface.known_first(axis) === nothing |
| 28 | + @test ArrayInterface.known_last(axis) === nothing |
| 29 | + @test ArrayInterface.known_length(axis) === nothing |
| 30 | + |
21 | 31 | axis = eachindex(AxisArray(3:4, one_pad(sym_pad=2))) |
22 | 32 | x = map(identity, axis) |
23 | 33 | @test x == axis |
|
0 commit comments