From 77f1c73a1f5f75ff03868cd4258bd239064e7eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Wed, 9 Oct 2024 09:18:56 +0200 Subject: [PATCH] Respect RMS tolerance --- .../usefulness/testing/screenshot/verification/Recorder.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/screenshot-testing-plugin/src/main/kotlin/io/github/usefulness/testing/screenshot/verification/Recorder.kt b/screenshot-testing-plugin/src/main/kotlin/io/github/usefulness/testing/screenshot/verification/Recorder.kt index deb9665..1a6dfa5 100644 --- a/screenshot-testing-plugin/src/main/kotlin/io/github/usefulness/testing/screenshot/verification/Recorder.kt +++ b/screenshot-testing-plugin/src/main/kotlin/io/github/usefulness/testing/screenshot/verification/Recorder.kt @@ -61,7 +61,12 @@ internal class Recorder( } is ComparisonMethod.RootMeanSquareErrorValue -> { existing, incoming -> - existing.getRootMeetSquare(incoming) + val rms = existing.getRootMeetSquare(incoming) + if (rms > comparisonMethod.tolerance) { + rms + } else { + 0 + } } }