Case

sameLine

This scope affects coverage ranges beginning on the same line as the token.

Declaration

case sameLine

Discussion

This scope is useful for functions like assert, which have untestable diagnostic messages:

assert(x == y, "There is a problem: \(problem)") // ↑↑↑ // The string interpolation cannot be covered by tests... // ...but the “assert” token causes it to be exempt.

This is also the scope of the general exemption, @exempt(from: tests).

func untestableFunction() { // @exempt(from: tests) // This is exempt. }
macOS CentOS Ubuntu Amazon Linux