github.com/leanovate/gopter@v0.2.9/CHANGELOG.md (about)

     1  # Change log
     2  
     3  ## [Unreleased]
     4  ### Additions
     5  - `gopter.GenParameters` now has a `CloneWithSeed(seed int64)` function to
     6    temparary copies to create rerunable sections of code.
     7  - Added `gopter.Gen.MapResult` for power-user mappings
     8  - Added `gopter.DeriveGen` to derive a generator and it's shrinker from a
     9    bi-directional mapping (`gopter.BiMapper`)
    10  
    11  ### Changed
    12  - Refactored `commands` package under the hood to allow the use of mutable state.
    13    Re-runability of commands is provided by invoking the `commands.GenInitialState`
    14    generator with the same `gopter.GenParameters`. Of course `commands.GenInitialState`
    15    is supposed to create the same state for the same parameters every time.
    16  - Fixed a bug in `commands` that might lead to shrinked command sequences not
    17    satisfying the precondtions.
    18  - `commands.Command.PostCondition` was called with the state before running the command. It makes
    19    much more sense to first do `commands.Command.NextState` and then `commands.Command.PostCondition`
    20  - `commands.Commands.NewSystemUnderTest` now takes has an argument `initialState commands.State` to
    21    allow implementators to create/bootstrap a system under test based on an arbitrary initial state.
    22    So far examples were just using a constant initial state ... which is a bit boring.
    23  - Fixed: Actually use `commands.Commands.InitialPreCondition` as sieve for
    24    `commands.Commands.GenInitialState`
    25  - Gen.Map and Shrink.Map now accept `interface{}` instead of `func (interface{}) interface{}`
    26  
    27    This allows cleaner mapping functions without type conversion. E.g. instead of
    28  
    29    ```Go
    30    gen.AnyString().Map(function (v interface{}) interface{} {
    31       return strings.ToUpper(v.(string))
    32    })
    33    ```
    34    you can (and should) now write
    35  
    36    ```Go
    37    gen.AnyString().Map(function (v string) string {
    38       return strings.ToUpper(v)
    39    })
    40    ```
    41  - Correspondingly Gen.SuchThat now also ccept `interface{}` instead of `func (interface{}) bool`
    42  
    43    This allows cleaner sieve functions without type conversion. E.g. instead of
    44  
    45    ```Go
    46    gen.AnyString().SuchThat(function (v interface{}) bool {
    47       return HasPrefix(v.(string), "P")
    48    })
    49    ```
    50    you can (and should) now write
    51  
    52    ```Go
    53    gen.AnyString().SuchThat(function (v string) bool {
    54       return HasPrefix(v, "P")
    55    })
    56    ```
    57  - Gen.FlatMap now has a second parameter `resultType reflect.Type` defining the result type of the mapped generator
    58  - Reason for these changes: The original `Map` and `FlatMap` had a recurring issue with empty results. If the original generator created an empty result there was no clean way to determine the result type of the mapped generator. The new version fixes this by extracting the return type of the mapping functions.
    59  
    60  ## [0.1] - 2016-04-30
    61  ### Added
    62  - Initial implementation.
    63  
    64  [Unreleased]: https://github.com/leanovate/gopter/compare/v0.1...HEAD
    65  [0.1]: https://github.com/leanovate/gopter/tree/v0.1