@@ -89,18 +89,18 @@ def test_run_line(self):
89
89
90
90
def test_completion (self ):
91
91
self .repl .height , self .repl .width = (5 , 32 )
92
- self .repl .current_line = 'se '
92
+ self .repl .current_line = 'an '
93
93
self .cursor_offset = 2
94
94
if config .supports_box_chars ():
95
- screen = ['>>> se ' ,
95
+ screen = ['>>> an ' ,
96
96
'┌───────────────────────┐' ,
97
- '│ set ( setattr( │' ,
97
+ '│ and any ( │' ,
98
98
'└───────────────────────┘' ,
99
99
'Welcome to bpython! Press <F1> f' ]
100
100
else :
101
- screen = ['>>> se ' ,
101
+ screen = ['>>> an ' ,
102
102
'+-----------------------+' ,
103
- '| set ( setattr( |' ,
103
+ '| and any ( |' ,
104
104
'+-----------------------+' ,
105
105
'Welcome to bpython! Press <F1> f' ]
106
106
self .assert_paint_ignoring_formatting (screen , (0 , 4 ))
@@ -284,12 +284,14 @@ def test_rewind_inconsistent_history_more_lines_same_screen(self):
284
284
self .repl .width = 60
285
285
sys .a = 5
286
286
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 ('' )
289
290
self .enter ('1 + 1' )
290
291
self .enter ('2 + 2' )
291
292
screen = ['>>> import sys' ,
292
- '>>> for i in range(sys.a): print(sys.a)' ,
293
+ '>>> for i in range(sys.a):' ,
294
+ '... print(sys.a)' ,
293
295
'... ' ,
294
296
'5' ,
295
297
'5' ,
@@ -301,9 +303,9 @@ def test_rewind_inconsistent_history_more_lines_same_screen(self):
301
303
'>>> 2 + 2' ,
302
304
'4' ,
303
305
'>>> ' ]
304
- self .assert_paint_ignoring_formatting (screen , (12 , 4 ))
306
+ self .assert_paint_ignoring_formatting (screen , (13 , 4 ))
305
307
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 ))
307
309
sys .a = 6
308
310
self .undo ()
309
311
screen = [INCONSISTENT_HISTORY_MSG [:self .repl .width ],
@@ -322,12 +324,14 @@ def test_rewind_inconsistent_history_more_lines_lower_screen(self):
322
324
self .repl .width = 60
323
325
sys .a = 5
324
326
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 ("" )
327
330
self .enter ("1 + 1" )
328
331
self .enter ("2 + 2" )
329
332
screen = [">>> import sys" ,
330
- ">>> for i in range(sys.a): print(sys.a)" ,
333
+ ">>> for i in range(sys.a):" ,
334
+ "... print(sys.a)" ,
331
335
'... ' ,
332
336
'5' ,
333
337
'5' ,
@@ -339,9 +343,9 @@ def test_rewind_inconsistent_history_more_lines_lower_screen(self):
339
343
'>>> 2 + 2' ,
340
344
'4' ,
341
345
'>>> ' ]
342
- self .assert_paint_ignoring_formatting (screen , (12 , 4 ))
346
+ self .assert_paint_ignoring_formatting (screen , (13 , 4 ))
343
347
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 ))
345
349
sys .a = 8
346
350
self .undo ()
347
351
screen = [INCONSISTENT_HISTORY_MSG [:self .repl .width ],
@@ -359,12 +363,14 @@ def test_rewind_inconsistent_history_more_lines_raise_screen(self):
359
363
self .repl .width = 60
360
364
sys .a = 5
361
365
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 ("" )
364
369
self .enter ("1 + 1" )
365
370
self .enter ("2 + 2" )
366
371
screen = [">>> import sys" ,
367
- ">>> for i in range(sys.a): print(sys.a)" ,
372
+ ">>> for i in range(sys.a):" ,
373
+ "... print(sys.a)" ,
368
374
'... ' ,
369
375
'5' ,
370
376
'5' ,
@@ -376,9 +382,9 @@ def test_rewind_inconsistent_history_more_lines_raise_screen(self):
376
382
'>>> 2 + 2' ,
377
383
'4' ,
378
384
'>>> ' ]
379
- self .assert_paint_ignoring_formatting (screen , (12 , 4 ))
385
+ self .assert_paint_ignoring_formatting (screen , (13 , 4 ))
380
386
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 ))
382
388
sys .a = 1
383
389
self .undo ()
384
390
screen = [INCONSISTENT_HISTORY_MSG [:self .repl .width ],
@@ -394,12 +400,14 @@ def test_rewind_inconsistent_history_more_lines_raise_screen(self):
394
400
def test_rewind_history_not_quite_inconsistent (self ):
395
401
self .repl .width = 50
396
402
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 ("" )
399
406
self .enter ("1 + 1" )
400
407
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
+ "... " ,
403
411
'0' ,
404
412
'1' ,
405
413
'2' ,
@@ -410,9 +418,9 @@ def test_rewind_history_not_quite_inconsistent(self):
410
418
'>>> 2 + 2' ,
411
419
'4' ,
412
420
'>>> ' ]
413
- self .assert_paint_ignoring_formatting (screen , (11 , 4 ))
421
+ self .assert_paint_ignoring_formatting (screen , (12 , 4 ))
414
422
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 ))
416
424
sys .a = 6
417
425
self .undo ()
418
426
screen = ['5' ,
0 commit comments