Skip to content

Commit a087395

Browse files
committed
fix some tests and add some new ones
1 parent 5f9bb55 commit a087395

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Lib/idlelib/idle_test/test_editor.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"Test editor, coverage 53%."
1+
"Test editor, coverage approximately 53%."
22

33
from idlelib import editor
44
import unittest
@@ -260,6 +260,10 @@ class DeleteWantTest(unittest.TestCase):
260260
(13, 4, "abcde\tabd\t "),
261261
(16, 4, "abcde\tabd\t \t"),
262262
]),
263+
("\tabcd", [
264+
(2, 4, ""),
265+
(5, 4, "\ta"),
266+
]),
263267
]
264268

265269
def mock_delete_trail_char_and_space(self, want, chars, tabwidth):
@@ -279,7 +283,7 @@ def test_delete_trail_char_and_space(self):
279283
for dat in self.data:
280284
test_str = dat[0]
281285
for da in dat[1]:
282-
with self.subTest(want=da[0], tabwidth=da[1], input=repr(test_str)):
286+
with self.subTest(want=da[0], tabwidth=da[1], input=test_str):
283287
res_str = ew.delete_trail_char_and_space(da[0], test_str, da[1])[1]
284288
self.assertEqual(res_str, da[2])
285289
time_new = time.time() - initial_time_new
@@ -290,7 +294,7 @@ def test_delete_trail_char_and_space(self):
290294
for dat in self.data:
291295
test_str = dat[0]
292296
for da in dat[1]:
293-
with self.subTest(want=da[0], tabwidth=da[1], input=repr(test_str)):
297+
with self.subTest(want=da[0], tabwidth=da[1], input=test_str):
294298
res_str = ew.delete_trail_char_and_space(da[0], test_str, da[1])[1]
295299
self.assertEqual(res_str, da[2])
296300
time_old = time.time() - initial_time_old

0 commit comments

Comments
 (0)