diff --git a/docs/src/interfaces.md b/docs/src/interfaces.md index 9651ec6..4897193 100644 --- a/docs/src/interfaces.md +++ b/docs/src/interfaces.md @@ -39,6 +39,7 @@ Supposition.target!(::Float64) Supposition.assume!(::Bool) Supposition.produce!(::Data.Possibility) Supposition.reject! +Supposition.event! Supposition.err_less Supposition.DEFAULT_CONFIG ``` diff --git a/src/Supposition.jl b/src/Supposition.jl index ba3bd2b..138919d 100644 --- a/src/Supposition.jl +++ b/src/Supposition.jl @@ -16,7 +16,7 @@ The package features: """ module Supposition -export assume!, target!, event!, reject, example +export assume!, target!, event!, reject!, example export Data, @composed, @check using Base diff --git a/src/api.jl b/src/api.jl index e93dde7..6960b09 100644 --- a/src/api.jl +++ b/src/api.jl @@ -524,7 +524,7 @@ Update the currently running testcase to track the given score as its target. `score` must be `convert`ible to a `Float64`. -!!! warning "Multiple Updates" +!!! danger "Multiple Updates" This score can only be set once! Repeated calls will be ignored. !!! warning "Callability" @@ -581,6 +581,11 @@ Data.produce!(p::Data.Possibility) = Data.produce!(CURRENT_TESTCASE[], p) Record `obj` as an event in the current testcase that occured while running your property. If no `label` is given, a default one will be chosen. + +!!! warning "Callability" + This can only be called while a testcase is currently being examined or an example for a `Possibility` + is being actively generated. It is ok to call this inside of `@composed` or `@check`, as well as any + functions only intended to be called from one of those places. """ function event! end diff --git a/src/data.jl b/src/data.jl index 787e63a..b74611c 100644 --- a/src/data.jl +++ b/src/data.jl @@ -37,7 +37,7 @@ as well as these utility functions: module Data using Supposition -using Supposition: smootherstep, lerp, TestCase, choice!, weighted!, forced_choice! +using Supposition: smootherstep, lerp, TestCase, choice!, weighted!, forced_choice!, reject using RequiredInterfaces: @required """ diff --git a/src/precompile.jl b/src/precompile.jl index 7e02929..c4ea1c6 100644 --- a/src/precompile.jl +++ b/src/precompile.jl @@ -16,7 +16,7 @@ using PrecompileTools i isa Int end rejects(i::Int8) = begin - reject() + reject!() i isa Int end errors(_) = error()