Skip to content

Instantly share code, notes, and snippets.

@mhshams
Created March 24, 2014 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhshams/9750569 to your computer and use it in GitHub Desktop.
Save mhshams/9750569 to your computer and use it in GitHub Desktop.
unit tests.
test fun `testing a simple add operation`() {
assertEquals(4, 2 + 2, "2 + 2 = 4")
}
@mhshams
Copy link
Author

mhshams commented Mar 24, 2014

How about (mis)using backtick character (`) to define nicer, and probably more readable, names for test methods?

In Kotlin code, one can use backtick character (`) to escape property or method names that are valid identifiers in the language. This is, particularly, useful when you are using a java library which has kotlin identifiers as variable or method name (e.g. in, is, object etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment