@@ -73,22 +73,33 @@ def test_nav_arrow_down(self):
73
73
@skipIfAsan
74
74
@skipIfEditlineSupportMissing
75
75
@expectedFailureAll (oslist = ['freebsd' ], bugnumber = 'llvm.org/pr48316' )
76
- def test_nav_arrow_up_empty_pr49845 (self ):
77
- """Tests that navigating with the up arrow doesn't crash."""
76
+ @skipIf (oslist = ["linux" ], archs = ["arm" , "aarch64" ]) # Randomly fails on buildbot
77
+ def test_nav_arrow_up_empty (self ):
78
+ """
79
+ Tests that navigating with the up arrow doesn't crash and skips
80
+ empty history entries.
81
+ """
78
82
self .launch ()
79
83
80
- # Create an empty history session by only entering a newline.
84
+ # Create a real history entry '456' and then follow up with an
85
+ # empty entry (that shouldn't be saved).
86
+ self .child .sendline ("expr" )
87
+ self .child .expect_exact ("terminate with an empty line to evaluate" )
88
+ self .child .send ("456\n \n " )
89
+ self .expect_prompt ()
90
+
81
91
self .child .sendline ("expr" )
82
92
self .child .expect_exact ("terminate with an empty line to evaluate" )
83
93
self .child .send ("\n " )
84
94
self .expect_prompt ()
85
95
86
- # Send just the up arrow in the expression evaluator. This should bring up the previous empty expression.
96
+ # The up arrow should recall the actual history entry and not the
97
+ # the empty entry (as that one shouldn't have been saved).
87
98
self .child .sendline ("expr" )
88
99
self .child .expect_exact ("terminate with an empty line to evaluate" )
89
100
self .child .send (self .arrow_up )
90
- self .child .expect_exact ("1: " )
91
- self .child .send ("\n " )
101
+ self .child .expect_exact ("456 " )
102
+ self .child .send ("\n \n " )
92
103
self .expect_prompt ()
93
104
94
105
self .quit ()
0 commit comments