Add Konsist test to use isNull() instead of isEqualTo(null), and fix existing issue.
This commit is contained in:
parent
bd58d85b69
commit
a77ad88001
5 changed files with 19 additions and 8 deletions
|
|
@ -98,4 +98,16 @@ class KonsistTestTest {
|
|||
functionDeclaration.text.contains("isEqualTo(empty")
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `use isNull() instead of isEqualTo(null)`() {
|
||||
Konsist
|
||||
.scopeFromTest()
|
||||
.functions()
|
||||
// Exclude self
|
||||
.withoutName("use isNull() instead of isEqualTo(null)")
|
||||
.assertFalse { functionDeclaration ->
|
||||
functionDeclaration.text.contains("isEqualTo(null)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue