From 367c0044aa4d8ec0d90b17bf96ca3f992c2ec5b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81bastien=20Boulet?= Date: Mon, 19 Oct 2020 21:32:34 +0200 Subject: [PATCH] DRY: rely on Position.lineCaret --- .../main/scala/scalafix/internal/testkit/AssertDelta.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scalafix-testkit/src/main/scala/scalafix/internal/testkit/AssertDelta.scala b/scalafix-testkit/src/main/scala/scalafix/internal/testkit/AssertDelta.scala index aeec51c16..e4d9dc483 100644 --- a/scalafix-testkit/src/main/scala/scalafix/internal/testkit/AssertDelta.scala +++ b/scalafix-testkit/src/main/scala/scalafix/internal/testkit/AssertDelta.scala @@ -25,9 +25,7 @@ case class AssertDelta( sameKey(assert.key) && (assert.caretPosition match { case Some(carPos) => - (carPos.start == lintDiagnostic.position.start) && - (carPos.end == lintDiagnostic.position.end || - (carPos.start == (carPos.end - 1) && lintDiagnostic.position.start == lintDiagnostic.position.end)) && + carPos.lineCaret == lintDiagnostic.position.lineCaret && assert.expectedMessage.forall(_.trim == lintDiagnostic.message.trim) case None => sameLine(assert.anchorPosition)