Skip to content

Commit

Permalink
Change property length with operation - 1 to property lastIndex
Browse files Browse the repository at this point in the history
### What's done:
- Added new rule to replace ".length - 1" to ".lastIndex"
- Added warn tests
- Added fix tests
- Updated Readme (rule 6.2.4)

(#1140)
  • Loading branch information
Alexey Votintsev committed Mar 4, 2022
1 parent 7ab9210 commit 8c4a93e
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.cqfn.diktat.ruleset.chapter6


import org.cqfn.diktat.ruleset.rules.chapter6.UseLastIndex
import org.cqfn.diktat.util.FixTestBase

Expand All @@ -16,5 +15,4 @@ class UseLastIndexFixTest : FixTestBase("test/chapter6/lastIndex_change", ::UseL
fun `fix example with incorrect use length`() {
fixAndCompare("IncorrectUseLengthMinusOneExpected.kt", "IncorrectUseLengthMinusOneTest.kt")
}

}

0 comments on commit 8c4a93e

Please sign in to comment.