Skip to content

Instantly share code, notes, and snippets.

@cmathew
Created September 12, 2023 17:17
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 cmathew/f48da5fc9b03649c6f93b7da33390b5f to your computer and use it in GitHub Desktop.
Save cmathew/f48da5fc9b03649c6f93b7da33390b5f to your computer and use it in GitHub Desktop.
Unit test which specifies sample source code and which Android Lint issues(s) we’d like to run
lint()
.files(
kotlin(
"""
package com.wealthfront.lint.test
import java.math.BigDecimal
class MyComparisonTester {
val comparisonExpression = BigDecimal.ONE == BigDecimal.ZERO
fun comparisonMethod(): Boolean {
return BigDecimal.ONE != BigDecimal.ZERO
}
}
""",
).indented(),
)
.issues(FORBID_EQUALS_FOR_BIGDECIMALS)
.run()
.expect(“...”)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment