@@ -1952,11 +1952,11 @@ def test_bracketed_paste(self):
19521952 )
19531953 # fmt: on
19541954
1955- paste_start = " \x1b [200~"
1955+ paste_start = [ Event ( evt = "key" , data = "bracketed paste" , raw = bytearray ( b" \x1b [200~"))]
19561956 paste_end = "\x1b [201~"
19571957
19581958 events = itertools .chain (
1959- code_to_events ( paste_start ) ,
1959+ paste_start ,
19601960 code_to_events (input_code ),
19611961 code_to_events (paste_end ),
19621962 code_to_events ("\n " ),
@@ -1968,11 +1968,11 @@ def test_bracketed_paste(self):
19681968 def test_bracketed_paste_single_line (self ):
19691969 input_code = "oneline"
19701970
1971- paste_start = " \x1b [200~"
1971+ paste_start = [ Event ( evt = "key" , data = "bracketed paste" , raw = bytearray ( b" \x1b [200~"))]
19721972 paste_end = "\x1b [201~"
19731973
19741974 events = itertools .chain (
1975- code_to_events ( paste_start ) ,
1975+ paste_start ,
19761976 code_to_events (input_code ),
19771977 code_to_events (paste_end ),
19781978 code_to_events ("\n " ),
@@ -1982,7 +1982,11 @@ def test_bracketed_paste_single_line(self):
19821982 self .assertEqual (output , input_code )
19831983
19841984 def test_bracketed_paste_in_isearch (self ):
1985- paste_start = "\x1b [200~"
1985+ # The bracketed-paste *start* marker is translated into a synthetic
1986+ # ``bracketed paste`` event by the real event queue; the fake console
1987+ # used here does not run that translation, so we feed the
1988+ # ``bracketed paste`` event directly.
1989+ paste_start = [Event (evt = "key" , data = "bracketed paste" , raw = bytearray (b"\x1b [200~" ))]
19861990 paste_end = "\x1b [201~"
19871991
19881992 events = itertools .chain (
@@ -1992,7 +1996,7 @@ def test_bracketed_paste_in_isearch(self):
19921996 [
19931997 Event (evt = "key" , data = "\x12 " , raw = bytearray (b"\x12 " )),
19941998 ],
1995- code_to_events ( paste_start ) ,
1999+ paste_start ,
19962000 code_to_events ("hello" ),
19972001 code_to_events (paste_end ),
19982002 [
@@ -2003,7 +2007,7 @@ def test_bracketed_paste_in_isearch(self):
20032007 Event (evt = "key" , data = "\x12 " , raw = bytearray (b"\x12 " )),
20042008 ],
20052009 # Search for 'world', which should not be found
2006- code_to_events ( paste_start ) ,
2010+ paste_start ,
20072011 code_to_events ("world" ),
20082012 code_to_events (paste_end ),
20092013 [
0 commit comments