2

How can I escape a function name so that it can span multiple lines? For example

@Test
fun `This is a really long description of what should happen to this function when the IDs do not match up.`() {
  // test
}

What I would want is something like

@Test
fun `This is a really long description of what should happen to this \
     function when the IDs do not match up.`() { // test }

Is this possible?

TheRealFakeNews
  • 7,512
  • 16
  • 73
  • 114

1 Answers1

0

It is not possible, function names convention allows spaces in test methods but not multiple lines : https://kotlinlang.org/docs/coding-conventions.html#names-for-test-methods

In tests (and only in tests), you can use method names with spaces enclosed in backticks.

A method with multiple lines in its name would not be callable even through reflection. (see https://stackoverflow.com/a/45750788/7346454)

Thomas Martin
  • 678
  • 8
  • 19