From 41115d50fa614a2d1c5668c7c9a13c1388b36bf7 Mon Sep 17 00:00:00 2001 From: freddiewanah Date: Mon, 24 Jul 2023 14:15:35 +1000 Subject: [PATCH] Refactoring assert to improve code quality --- tests/test_trans.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_trans.py b/tests/test_trans.py index dce8a939677..784e852e12a 100644 --- a/tests/test_trans.py +++ b/tests/test_trans.py @@ -13,7 +13,7 @@ def check( # a glance than only spans assert len(spans) == len(expected_slices) for (i, j), slice in zip(spans, expected_slices): - assert len(string[i:j]) == j - i + assert 0 <= i <= j <= len(string) assert string[i:j] == slice assert spans == expected_spans