Skip to content

[wishlist] dynamic test registration #306

@dimo414

Description

@dimo414

It would be nice to be able to register test functions at runtime, in addition to the @test preprocessor behavior. Something like:

bats::register_test is_prime 2 true
bats::register_test is_prime 3 true
bats::register_test is_prime 4 false

is_prime() { .... }

#241 is closely related; it's possible implementing that would address this need. Alternatively, implementing this could be sufficient for users to construct their own parameterization on top. I'm not sure we need both features or not, but I can see them both being useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: Bash CodeEverything regarding the bash codePriority: HighBroken behavior in specific environments like in parallel mode or only on some operating systemsType: Enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions