|
223 | 223 | end |
224 | 224 | =# |
225 | 225 |
|
226 | | - #= TODO |
227 | 226 | @testset "equality" begin |
228 | | - nda = AxisArray([10 20; 30 40], (:x, :y)) |
229 | | - nda2 = AxisArray([10 20; 30 40], (:x, :_)) |
230 | | - nda3 = AxisArray([10 20; 30 40], (:x, :z)) |
231 | | - nda4 = AxisArray([11 22; 33 44], (:x, :y)) |
232 | | - ndv = AxisArray([10, 20, 30], (:x,)) |
| 227 | + a = AxisArray([10 20; 30 40]) |
| 228 | + a2 = AxisArray([10 20; 30 40]) |
| 229 | + a3 = AxisArray([10 20; 30 40]) |
| 230 | + a4 = AxisArray([11 22; 33 44]) |
| 231 | + v = AxisArray([10, 20, 30]) |
233 | 232 |
|
234 | 233 | @testset "$eq" for eq in (Base.:(==), isequal, isapprox) |
235 | | - @test eq(nda, nda) |
236 | | - @test eq(nda, nda2) |
237 | | - @test eq(nda, nda3) == false |
238 | | - @test eq(nda, nda4) == false |
239 | | - @test eq(nda, ndv) == false |
| 234 | + @test eq(a, a) == eq(parent(a), a) == eq(a, parent(a)) |
| 235 | + @test eq(a, a2) |
| 236 | + @test eq(a, a3) |
| 237 | + @test !eq(a, a4) |
240 | 238 | end |
241 | | - @test isapprox(nda, nda4; atol=2π) |
| 239 | + @test isapprox(a, a4; atol=2π) |
| 240 | + @test isapprox(a, parent(a4); atol=2π) |
| 241 | + @test isapprox(parent(a), a4; atol=2π) |
| 242 | + @test AxisArray(1:2) == SimpleAxis(1:2) |
242 | 243 | end |
243 | | - =# |
244 | 244 |
|
245 | 245 | end # Base |
246 | 246 |
|
|
0 commit comments