Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: flyingmutant/rapid
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.1.0
Choose a base ref
...
head repository: flyingmutant/rapid
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.2.0
Choose a head ref
  • 13 commits
  • 15 files changed
  • 3 contributors

Commits on Aug 8, 2023

  1. CI: test on Go 1.21

    flyingmutant committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    efc31a7 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2023

  1. persist: ensure we never try to use a filename that is reserved on wi…

    …ndows
    
    This only happens in test runs, since real test name always start with 'Test'
    flyingmutant committed Nov 4, 2023
    Configuration menu
    Copy the full SHA
    d56e037 View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2024

  1. StateMachineActions: Support func(rapid.TB) actions

    This allows reuse actions from normal tests that use `testing.TB`.
    
    This is helpful for tests where there may be very specific test
    scenarios where some logic is abstracted into a common action.
    prashantv authored and flyingmutant committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    cee6e9b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fec3f59 View commit details
    Browse the repository at this point in the history
  3. Fix typo

    prashantv authored and flyingmutant committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    34cb5b2 View commit details
    Browse the repository at this point in the history

Commits on May 12, 2024

  1. Configuration menu
    Copy the full SHA
    654675a View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2024

  1. Configuration menu
    Copy the full SHA
    3aa554a View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2024

  1. CI: test on Go 1.22

    flyingmutant committed Jul 27, 2024
    Configuration menu
    Copy the full SHA
    4d1266b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ee28b02 View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2024

  1. CI: test on Go 1.23

    flyingmutant committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    4b93305 View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2025

  1. ci: Test with Go 1.24

    Go 1.24 was released last week.
    Test against Go 1.24 in CI as well.
    
    (Per Go support policy, 1.21 and 1.22 are no longer supported,
    but I've left them around as rapid may still want to support them.)
    abhinav authored and flyingmutant committed Feb 16, 2025
    Configuration menu
    Copy the full SHA
    ecc839f View commit details
    Browse the repository at this point in the history

Commits on Feb 20, 2025

  1. feat: Add T.Context() (#77)

    * feat: Add T.Context()
    
    *Context*:
    Go 1.24 adds a `Context()` method to `testing.TB` that returns
    a context bound to the current test's lifetime.
    The context becomes invalid _before_ `T.Cleanup` functions are run.
    
    *Details*:
    This change adds a similar `Context()` method to `rapid.T`,
    except this context is only valid for the duration of one iteration
    of a rapid check.
    
    *Implementation notes*:
    This changes `newT` to return a `cancel` function
    instead of just adding a `cancel` method to `T`
    to ensure that all callers of `newT` remember to call `cancel`.
    
    This also uses IIFEs (immediately-invoked function expressions)
    in a couple places to rely on well-timed `defer` calls for cleanup
    instead of manually calling `cancel`.
    
    *Future work*:
    The logic added in this commit will make it relatively straightforward
    to add a `Cleanup` method (#62).
    
    * lazy init, cleanup in checkOnce, maybeValue, example
    
    Per GitHub comment, delete the `cancel` return value from newT,
    instead add a single `cleanup` method.
    
    The method is called for cleanup in three places:
    
    - checkOnce: this is per property
    - maybeValue: this is per Custom generator function call
    - example: this is per Example call
    
    Context is now initialized lazily:
    if there isn't one, it is created.
    
    * fix: data race in t.ctx access
    abhinav authored Feb 20, 2025
    Configuration menu
    Copy the full SHA
    c3c5e3c View commit details
    Browse the repository at this point in the history

Commits on Feb 24, 2025

  1. feat: Add T.Cleanup (#79)

    * feat: Add T.Cleanup
    
    Adds a new T.Cleanup method to register cleanup functions.
    These will run after each iteration of a Check.
    
    The implementation of how cleanup functions are tracked and run
    is borrowed heavily from testing.T's own implementation.
    Namely:
    
    - [T.Cleanup puts functions in a slice](https://cs.opensource.google/go/go/+/refs/tags/go1.24.0:src/testing/testing.go;l=1214-1216)
    - [cleanups are run in reverse order](https://cs.opensource.google/go/go/+/refs/tags/go1.24.0:src/testing/testing.go;l=1433-1446)
      popping functions from the slice one by one
    - [panics are not allowed to interrupt cleanup](https://cs.opensource.google/go/go/+/refs/tags/go1.24.0:src/testing/testing.go;l=1420-1427)
    
    As with `testing.T`, cleanup runs after the context is canceled.
    Because Rapid's context is lazily initialized,
    it needs an additional check to avoid providing a valid context
    during cleanup.
    
    Resolves #62
    
    * doc: try to be clearer
    abhinav authored Feb 24, 2025
    Configuration menu
    Copy the full SHA
    7adc026 View commit details
    Browse the repository at this point in the history
Loading