diff options
| author | Martin Hořeňovský | 2019-10-27 09:17:15 +0100 |
|---|---|---|
| committer | GitHub | 2019-10-27 09:17:15 +0100 |
| commit | 9a558171d836cf7b292883b6f65bdd937c30cc76 (patch) | |
| tree | 93b5af6d1abc58522f38b539e58d95ee0bbe24c1 /docs/generators.md | |
| parent | c5c688820c919e202304b885df1c5a920ff7eb4e (diff) | |
| parent | 6a0822586382fcfa4bae4378b12656036850f959 (diff) | |
| download | catch3-9a558171d836cf7b292883b6f65bdd937c30cc76.tar.gz | |
Merge pull request #1776 from mvd4/bugfix/enable-floating-point-ranges
Enable floating point ranges
Diffstat (limited to 'docs/generators.md')
| -rw-r--r-- | docs/generators.md | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/generators.md b/docs/generators.md index 61276f3c..d0147d7f 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -49,7 +49,7 @@ a test case, * 4 specific purpose generators * `RandomIntegerGenerator<Integral>` -- generates random Integrals from range * `RandomFloatGenerator<Float>` -- generates random Floats from range - * `RangeGenerator<T>` -- generates all values inside a specific range + * `RangeGenerator<T>` -- generates all values inside an arithmetic range * `IteratorGenerator<T>` -- copies and returns values from an iterator range > `ChunkGenerator<T>`, `RandomIntegerGenerator<Integral>`, `RandomFloatGenerator<Float>` and `RangeGenerator<T>` were introduced in Catch 2.7.0. @@ -69,8 +69,8 @@ type, making their usage much nicer. These are * `map<T>(func, GeneratorWrapper<U>&&)` for `MapGenerator<T, U, Func>` (map `U` to `T`) * `chunk(chunk-size, GeneratorWrapper<T>&&)` for `ChunkGenerator<T>` * `random(IntegerOrFloat a, IntegerOrFloat b)` for `RandomIntegerGenerator` or `RandomFloatGenerator` -* `range(start, end)` for `RangeGenerator<T>` with a step size of `1` -* `range(start, end, step)` for `RangeGenerator<T>` with a custom step size +* `range(Arithemtic start, Arithmetic end)` for `RangeGenerator<Arithmetic>` with a step size of `1` +* `range(Arithmetic start, Arithmetic end, Arithmetic step)` for `RangeGenerator<Arithmetic>` with a custom step size * `from_range(InputIterator from, InputIterator to)` for `IteratorGenerator<T>` * `from_range(Container const&)` for `IteratorGenerator<T>` @@ -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: |