Skip to content

Commit

Permalink
fix tests and docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
simeonschaub committed Feb 11, 2020
1 parent 24907a9 commit 0a696be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/OptionalArgChecks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ using MacroTools: postwalk
export @mark, @elide#, @skipargcheck

"""
@argcheck ex
@mark label ex
Marks `ex` as an optional argument check, so when a function is called via
[`@skipargcheck`](@ref), `ex` will be omitted.
```jldoctest
julia> function half(x::Integer)
@argcheck iseven(x) || throw(DomainError(x, "x has to be an even number"))
@mark iseven(x) || throw(DomainError(x, "x has to be an even number"))
return x ÷ 2
end
half (generic function with 1 method)
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test
using OptionalArgChecks

function f(x)
@argcheck x<2 && if x == 1
@mark argcheck x<2 && if x == 1
return "foo"
else
error("Test")
Expand Down

0 comments on commit 0a696be

Please sign in to comment.