Skip to content

Commit

Permalink
update zip test for nothings
Browse files Browse the repository at this point in the history
  • Loading branch information
lxvm committed Jan 17, 2024
1 parent 2bf7633 commit 734a6c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/lib/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ end
@testset "adjoints of Iterators.zip" begin
y, back = _pullback(Iterators.zip, 1:5, 1:3, 1:2)
@test back(collect(y)) == (nothing, [1.0, 2.0, 0.0, 0.0, 0.0], [1.0, 2.0, 0.0], [1.0, 2.0])
@test back([(nothing, j, k) for (i,j,k) in zip(1:5, 1:3, 1:2)]) == (nothing, Union{Nothing, Float64}[nothing, nothing, 0.0, 0.0, 0.0], [1.0, 2.0, 0.0], [1.0, 2.0])
@test back([(i, nothing, k) for (i,j,k) in zip(1:5, 1:3, 1:2)]) == (nothing, [1.0, 2.0, 0.0, 0.0, 0.0], Union{Nothing, Float64}[nothing, nothing, 0.0], [1.0, 2.0])
@test back([(nothing, j, k) for (i,j,k) in zip(1:5, 1:3, 1:2)]) == (nothing, nothing, [1.0, 2.0, 0.0], [1.0, 2.0])
@test back([(i, nothing, k) for (i,j,k) in zip(1:5, 1:3, 1:2)]) == (nothing, [1.0, 2.0, 0.0, 0.0, 0.0], nothing, [1.0, 2.0])
@test back([(i, j, nothing) for (i,j,k) in zip(1:5, 1:3, 1:2)]) == (nothing, [1.0, 2.0, 0.0, 0.0, 0.0], [1.0, 2.0, 0.0], nothing)


Expand Down

0 comments on commit 734a6c4

Please sign in to comment.