@@ -89,18 +89,18 @@ def test_run_line(self):
8989
9090 def test_completion (self ):
9191 self .repl .height , self .repl .width = (5 , 32 )
92- self .repl .current_line = 'se '
92+ self .repl .current_line = 'an '
9393 self .cursor_offset = 2
9494 if config .supports_box_chars ():
95- screen = ['>>> se ' ,
95+ screen = ['>>> an ' ,
9696 '┌───────────────────────┐' ,
97- '│ set ( setattr( │' ,
97+ '│ and any ( │' ,
9898 '└───────────────────────┘' ,
9999 'Welcome to bpython! Press <F1> f' ]
100100 else :
101- screen = ['>>> se ' ,
101+ screen = ['>>> an ' ,
102102 '+-----------------------+' ,
103- '| set ( setattr( |' ,
103+ '| and any ( |' ,
104104 '+-----------------------+' ,
105105 'Welcome to bpython! Press <F1> f' ]
106106 self .assert_paint_ignoring_formatting (screen , (0 , 4 ))
@@ -284,12 +284,14 @@ def test_rewind_inconsistent_history_more_lines_same_screen(self):
284284 self .repl .width = 60
285285 sys .a = 5
286286 self .enter ('import sys' )
287- self .enter ('for i in range(sys.a): print(sys.a)' )
288- self .enter ()
287+ self .enter ('for i in range(sys.a):' )
288+ self .enter (' print(sys.a)' )
289+ self .enter ('' )
289290 self .enter ('1 + 1' )
290291 self .enter ('2 + 2' )
291292 screen = ['>>> import sys' ,
292- '>>> for i in range(sys.a): print(sys.a)' ,
293+ '>>> for i in range(sys.a):' ,
294+ '... print(sys.a)' ,
293295 '... ' ,
294296 '5' ,
295297 '5' ,
@@ -301,9 +303,9 @@ def test_rewind_inconsistent_history_more_lines_same_screen(self):
301303 '>>> 2 + 2' ,
302304 '4' ,
303305 '>>> ' ]
304- self .assert_paint_ignoring_formatting (screen , (12 , 4 ))
306+ self .assert_paint_ignoring_formatting (screen , (13 , 4 ))
305307 self .repl .scroll_offset += len (screen ) - self .repl .height
306- self .assert_paint_ignoring_formatting (screen [8 :], (4 , 4 ))
308+ self .assert_paint_ignoring_formatting (screen [9 :], (4 , 4 ))
307309 sys .a = 6
308310 self .undo ()
309311 screen = [INCONSISTENT_HISTORY_MSG [:self .repl .width ],
@@ -322,12 +324,14 @@ def test_rewind_inconsistent_history_more_lines_lower_screen(self):
322324 self .repl .width = 60
323325 sys .a = 5
324326 self .enter ("import sys" )
325- self .enter ("for i in range(sys.a): print(sys.a)" )
326- self .enter ()
327+ self .enter ("for i in range(sys.a):" )
328+ self .enter (" print(sys.a)" )
329+ self .enter ("" )
327330 self .enter ("1 + 1" )
328331 self .enter ("2 + 2" )
329332 screen = [">>> import sys" ,
330- ">>> for i in range(sys.a): print(sys.a)" ,
333+ ">>> for i in range(sys.a):" ,
334+ "... print(sys.a)" ,
331335 '... ' ,
332336 '5' ,
333337 '5' ,
@@ -339,9 +343,9 @@ def test_rewind_inconsistent_history_more_lines_lower_screen(self):
339343 '>>> 2 + 2' ,
340344 '4' ,
341345 '>>> ' ]
342- self .assert_paint_ignoring_formatting (screen , (12 , 4 ))
346+ self .assert_paint_ignoring_formatting (screen , (13 , 4 ))
343347 self .repl .scroll_offset += len (screen ) - self .repl .height
344- self .assert_paint_ignoring_formatting (screen [8 :], (4 , 4 ))
348+ self .assert_paint_ignoring_formatting (screen [9 :], (4 , 4 ))
345349 sys .a = 8
346350 self .undo ()
347351 screen = [INCONSISTENT_HISTORY_MSG [:self .repl .width ],
@@ -359,12 +363,14 @@ def test_rewind_inconsistent_history_more_lines_raise_screen(self):
359363 self .repl .width = 60
360364 sys .a = 5
361365 self .enter ("import sys" )
362- self .enter ("for i in range(sys.a): print(sys.a)" )
363- self .enter ()
366+ self .enter ("for i in range(sys.a):" )
367+ self .enter (" print(sys.a)" )
368+ self .enter ("" )
364369 self .enter ("1 + 1" )
365370 self .enter ("2 + 2" )
366371 screen = [">>> import sys" ,
367- ">>> for i in range(sys.a): print(sys.a)" ,
372+ ">>> for i in range(sys.a):" ,
373+ "... print(sys.a)" ,
368374 '... ' ,
369375 '5' ,
370376 '5' ,
@@ -376,9 +382,9 @@ def test_rewind_inconsistent_history_more_lines_raise_screen(self):
376382 '>>> 2 + 2' ,
377383 '4' ,
378384 '>>> ' ]
379- self .assert_paint_ignoring_formatting (screen , (12 , 4 ))
385+ self .assert_paint_ignoring_formatting (screen , (13 , 4 ))
380386 self .repl .scroll_offset += len (screen ) - self .repl .height
381- self .assert_paint_ignoring_formatting (screen [8 :], (4 , 4 ))
387+ self .assert_paint_ignoring_formatting (screen [9 :], (4 , 4 ))
382388 sys .a = 1
383389 self .undo ()
384390 screen = [INCONSISTENT_HISTORY_MSG [:self .repl .width ],
@@ -394,12 +400,14 @@ def test_rewind_inconsistent_history_more_lines_raise_screen(self):
394400 def test_rewind_history_not_quite_inconsistent (self ):
395401 self .repl .width = 50
396402 sys .a = 5
397- self .enter ("for i in range(__import__('sys').a): print(i)" )
398- self .enter ()
403+ self .enter ("for i in range(__import__('sys').a):" )
404+ self .enter (" print(i)" )
405+ self .enter ("" )
399406 self .enter ("1 + 1" )
400407 self .enter ("2 + 2" )
401- screen = [">>> for i in range(__import__('sys').a): print(i)" ,
402- '... ' ,
408+ screen = [">>> for i in range(__import__('sys').a):" ,
409+ "... print(i)" ,
410+ "... " ,
403411 '0' ,
404412 '1' ,
405413 '2' ,
@@ -410,9 +418,9 @@ def test_rewind_history_not_quite_inconsistent(self):
410418 '>>> 2 + 2' ,
411419 '4' ,
412420 '>>> ' ]
413- self .assert_paint_ignoring_formatting (screen , (11 , 4 ))
421+ self .assert_paint_ignoring_formatting (screen , (12 , 4 ))
414422 self .repl .scroll_offset += len (screen ) - self .repl .height
415- self .assert_paint_ignoring_formatting (screen [7 :], (4 , 4 ))
423+ self .assert_paint_ignoring_formatting (screen [8 :], (4 , 4 ))
416424 sys .a = 6
417425 self .undo ()
418426 screen = ['5' ,
0 commit comments