diff --git a/docs/src/interfaces.md b/docs/src/interfaces.md index 5c8a7ec..fdedadd 100644 --- a/docs/src/interfaces.md +++ b/docs/src/interfaces.md @@ -37,7 +37,7 @@ the hood, modify the currently running testcase. ```@docs Supposition.target!(::Float64) Supposition.assume!(::Bool) -Supposition.produce! +Supposition.produce!(::Data.Possibility) Supposition.reject! Supposition.DEFAULT_CONFIG ``` diff --git a/src/Supposition.jl b/src/Supposition.jl index daee827..d195076 100644 --- a/src/Supposition.jl +++ b/src/Supposition.jl @@ -31,7 +31,7 @@ export produce! """ DEFAULT_CONFIG -A `ScopedValue` holding the `CheckConfig` that will be used by default & as a fallback. +A `ScopedValue` holding the [`CheckConfig`](@ref) that will be used by default & as a fallback. Currently uses these values: @@ -42,7 +42,7 @@ Currently uses these values: * `broken`: `false` * `buffer_size`: `100_000` -`@check` will use a _new_ instance of `Random.Xoshiro` by itself. +[`@check`](@ref) will use a _new_ instance of `Random.Xoshiro` by itself. """ const DEFAULT_CONFIG = ScopedValue{CheckConfig}(CheckConfig(; rng=Random.Xoshiro(rand(Random.RandomDevice(), UInt)), diff --git a/src/api.jl b/src/api.jl index 4282459..e8f25f5 100644 --- a/src/api.jl +++ b/src/api.jl @@ -3,12 +3,14 @@ using Test: Test, @testset, @test using Logging: @debug """ - example(gen::Possibility; tries=100_000) + example(pos::Possibility; tries=100_000, generation::Int) Generate an example for the given `Possibility`. -`example` tries to have `gen` produce an example `tries` times -and throws an error if `gen` doesn't produce one in that timeframe. +`example` tries to have `pos` produce an example `tries` times +and throws an error if `pos` doesn't produce one in that timeframe. +`generation` indicates how "late" in a usual run of `@check` the example +might have been generated. Usage: @@ -37,9 +39,11 @@ function example(pos::Data.Possibility; tries=100_000, generation::Int=rand(1:50 end """ - example(gen::Possibility, n::Integer) + example(gen::Possibility, n::Integer; tries=100_000) -Generate `n` examples for the given `Possibility`. +Generate `n` examples for the given `Possibility`. Each example +is given `tries` attempts to generate. If any fail, the entire process +is aborted. ```julia-repl julia> using Supposition, Supposition.Data diff --git a/src/types.jl b/src/types.jl index 03cf861..5ac7ef6 100644 --- a/src/types.jl +++ b/src/types.jl @@ -77,7 +77,7 @@ Options: * `broken`: Whether the invocation is expected to fail. Defaults to `false`. * `buffer_size`: The default maximum buffer size to use for a test case. Defaults to `100_000`. -!!! warn "Buffer Size" +!!! warning "Buffer Size" At any one point, there may be more than one active buffer being worked on. You can try to increase this value when you encounter a lot of `Overrun`. Do not set this too large, or you're very likely to run out of memory; the default