Hacker News new | past | comments | ask | show | jobs | submit login

Kotlin has an interesting approach to solving this. You can name functions using backticks, and in those backticks you can put basically anything.

So it's common to see unit tests like

  @Test
  fun `this tests something very complicated`() {
    ...
  }



You can do that in Java as well. Can't remember if it's exactly the same syntax


I don't think you can do it in Java specifically. But once upon a time it was rather popular to write test fixtures for Java code in Groovy, which does let you do it.


My bad, it seems I was misremembering


You can't put spaces in the function name, but you can set a display name for JUnit - https://junit.org/junit5/docs/5.0.3/api/org/junit/jupiter/ap...


My bad, it seems I was misremembering




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: