From 6a0822586382fcfa4bae4378b12656036850f959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Sat, 26 Oct 2019 20:49:56 +0200 Subject: [PATCH] Add documentation for floating point `range` generator --- docs/generators.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/generators.md b/docs/generators.md index 61276f3cca..d0147d7f06 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -49,7 +49,7 @@ a test case, * 4 specific purpose generators * `RandomIntegerGenerator` -- generates random Integrals from range * `RandomFloatGenerator` -- generates random Floats from range - * `RangeGenerator` -- generates all values inside a specific range + * `RangeGenerator` -- generates all values inside an arithmetic range * `IteratorGenerator` -- copies and returns values from an iterator range > `ChunkGenerator`, `RandomIntegerGenerator`, `RandomFloatGenerator` and `RangeGenerator` were introduced in Catch 2.7.0. @@ -69,8 +69,8 @@ type, making their usage much nicer. These are * `map(func, GeneratorWrapper&&)` for `MapGenerator` (map `U` to `T`) * `chunk(chunk-size, GeneratorWrapper&&)` for `ChunkGenerator` * `random(IntegerOrFloat a, IntegerOrFloat b)` for `RandomIntegerGenerator` or `RandomFloatGenerator` -* `range(start, end)` for `RangeGenerator` with a step size of `1` -* `range(start, end, step)` for `RangeGenerator` with a custom step size +* `range(Arithemtic start, Arithmetic end)` for `RangeGenerator` with a step size of `1` +* `range(Arithmetic start, Arithmetic end, Arithmetic step)` for `RangeGenerator` with a custom step size * `from_range(InputIterator from, InputIterator to)` for `IteratorGenerator` * `from_range(Container const&)` for `IteratorGenerator` @@ -78,6 +78,8 @@ type, making their usage much nicer. These are > `from_range` has been introduced in Catch 2.10.0 +> `range()` for floating point numbers has been introduced in Catch X.Y.Z + And can be used as shown in the example below to create a generator that returns 100 odd random number: