swift-testing icon indicating copy to clipboard operation
swift-testing copied to clipboard

Update documentation to discuss raw identifiers.

Open grynspan opened this issue 11 months ago • 2 comments

We need to update our documentation, especially around @Suite and @Test, to discuss raw identifiers in place of the displayName argument. In particular, where we currently recommend something like:

@Test("foo bar baz") func f() { ... }

We probably want to offer this instead:

@Test func `foo bar baz`() { ... }

grynspan avatar Jan 07 '25 16:01 grynspan

The documentation for the Test and Suite macros should also explain that the display name can be specified with a raw identifier.

grynspan avatar May 05 '25 02:05 grynspan

Two broad areas we need to address before merging:

  • My thinking was we'd outright replace our current guidance around @Test("abc") func f() and eventually deprecate that syntax in favour of @Test func `abc`().
  • I am not sure if we call them "raw identifiers" elsewhere in the literature or just say something like "you can also use backticks to express a longer name for a test".

grynspan avatar Jun 16 '25 16:06 grynspan