Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lostella authored Dec 29, 2023
1 parent 18d139d commit c343469
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ end
@test is_generalized_quadratic(Zero())

for T in [Float32, Float64]
@test let x = T[1.0, 2.0, 3.0]
prox(Zero(), x, T(42)) == (x, T(0))
end
x = T[1.0, 2.0, 3.0]
@test Zero()(x) == T(0)
@test prox(Zero(), x, T(42)) == (x, T(0))
@test prox(Zero(), x, ) == (x, T(0))
end

end
Expand All @@ -52,9 +53,11 @@ end
@test is_generalized_quadratic(IndZero())

for T in [Float32, Float64]
@test let x = T[1.0, 2.0, 3.0]
prox(IndZero(), x, T(42)) == (T[0, 0, 0], T(0))
end
x = T[1.0, 2.0, 3.0]
@test IndZero()(x) == T(Inf)
@test IndZero()(T[0, 0, 0]) == T(0)
@test prox(IndZero(), x, T(42)) == (T[0, 0, 0], T(0))
@test prox(IndZero(), x) == (T[0, 0, 0], T(0))
end

end
Expand Down

0 comments on commit c343469

Please sign in to comment.