Open
Description
The current approach of using the spec()
function requires an extra level of nesting in tests, and it would be great to be able to omit it.
Previous approaches:
- A function body macro that effectively applied the
spec()
function invisibly. This was effective but not very usable. Function body macros have the inherent difficulty that the function body you see is completely detached from what is executed. Line numbers for test failures or most compile-time errors because useless. - A peer macro that could be applied to a function, and would generate the actual test function. The function you apply the macro to had to return
ExampleGroup
and explicitly use the @ExampleBuilder result builder, so it ended up looking like this:
@Exampale @ExampleBuilder func someExamples() -> ExampleGroup {
// various describe/context/it calls
}
All that boilerplate in the function declaration isn't really an improvement over calling spec()
.
Metadata
Metadata
Assignees
Labels
No labels
Activity