Skip to content

Commit

Permalink
fixup! Add constraints into the tour
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Aug 29, 2024
1 parent 171ec8e commit 32f11c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/tour.jl
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ end
# as this makes error message clearer:

@test NamedTuple(FinitePositiveV1(; a=1)) == (a=1,)
@test_throws "Legolas.CheckConstraintError: a > 0" FinitePositiveV1(; a=-1)
@test_throws "Legolas.CheckConstraintError: isfinite(a)" FinitePositiveV1(; a=Inf)
@test_throws "CheckConstraintError: a > 0" FinitePositiveV1(; a=-1)
@test_throws "CheckConstraintError: isfinite(a)" FinitePositiveV1(; a=Inf)

# All `@check` constraints must be defined after the fields and any processing on the field will occur before the
# constraints are checked:
Expand Down

0 comments on commit 32f11c0

Please sign in to comment.