Skip to content

Commit

Permalink
Add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
simsurace committed Feb 6, 2024
1 parent 4eb267b commit b58f524
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/flatten.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@
test_flatten_interface((1.0, 2.0); check_inferred=tuple_infers)

test_flatten_interface((1.0, (2.0, 3.0), randn(5)); check_inferred=tuple_infers)

# Prevent regression of PR #67
@testset "Type stability of unflatten" begin
θ = (1., ((2., 3.), 4.))
x, unflatten = flatten(θ)
@test (@inferred unflatten(x)) == θ
end
end

@testset "NamedTuple" begin
Expand Down

0 comments on commit b58f524

Please sign in to comment.