From dbd044309fb7bdf57b3d40f363d6058feab67d89 Mon Sep 17 00:00:00 2001 From: juliancoffee Date: Fri, 23 Apr 2021 14:11:44 +0300 Subject: [PATCH] Fix off-by-one error in localization tests BlameHunk lines start counting from 1, not 0. Comparing with `line + 1` fix this. --- voxygen/src/i18n.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/voxygen/src/i18n.rs b/voxygen/src/i18n.rs index 54710fe97e..6002b810b4 100644 --- a/voxygen/src/i18n.rs +++ b/voxygen/src/i18n.rs @@ -421,8 +421,8 @@ mod tests { }, }; - if line >= e.final_start_line() - && line < e.final_start_line() + e.lines_in_hunk() + if line + 1 >= e.final_start_line() + && line + 1 < e.final_start_line() + e.lines_in_hunk() { state.chuck_line_range = Some(( e.final_start_line(),