Skip to content

Commit 705c943

Browse files
committed
Add more equality tests
1 parent ab4ef6e commit 705c943

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "AxisIndices"
22
uuid = "f52c9ee2-1b1c-4fd8-8546-6350938c7f11"
33
authors = ["Tokazama <[email protected]>"]
4-
version = "0.5"
4+
version = "0.5.1"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

test/functions_tests.jl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -223,24 +223,24 @@
223223
end
224224
=#
225225

226-
#= TODO
227226
@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])
233232

234233
@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)
240238
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)
242243
end
243-
=#
244244

245245
end # Base
246246

0 commit comments

Comments
 (0)