Escaped Method Names

fun `is this syntax really necessary?`() {
  println("Well, it has its uses...")
}

`is this syntax really necessary?`()

The Scenario: JUnit Tests

Most of the time, function names are used purely within our code. Occasionally, though, function names get exposed outside of the code itself.

One such case is with JUnit, particularly the JUnit4 used for years in Android app development. JUnit is a popular unit testing harness and framework for Java and JVM languages. JUnit — and tools that use it, like IDEs and continuous integration (CI) servers — have “test runners” that execute designated test functions. By default, the output of the tests includes the names of the test classes and the test functions.


Prev Table of Contents Next

This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.