Skip to content

Proposal: changes for next major release (v4)Β #257

@dnephin

Description

@dnephin

With the opportunity to use generics to improve the assert package (#255), we may want to release a new major version. This issue is to discuss and track changes that would require a major version bump, so that we can include all of them when the time is right.

  1. Change the signature of the assert, and assert/cmp functions to use generics instead of any as the argument types (assert: use type constraints (generics)Β #255)

  2. Combine the skip, env, and poll packages into a single new package. These packages are very small, and combining them into a single package should make it easier to use gotest.tools by requiring fewer imports. I'm not sure what to name that package yet. They could be included as part of the assert package, but the names don't read as well.

  3. Replace the golden package with a GoldenFile(t, filename) function in the assert package. assert: golden variablesΒ #237 added support for golden-like behaviour using expected values stored in a Go variable. We should be able to do something similar:

    func GoldenFile(t TestingT, filename string) string { ... }

    Similar to golden variables, when called with -update, assert.Assert should be able to detect that the expected argument is a GoldenFile and use the actual value to update the specified filename.

  4. Maybe icmd could change to use context.Context to set the timeout instead of a time.Duration passed to WaitOnCommand ? Some way to pass a deadline/timeout using context.Context might be good.

Are there other breaking changes we should consider? Anything in fs that could change now that the stdlib has an fs package or because of generics?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions