@@ -34,19 +34,19 @@ func TestConsumeLeakedMouseKey_SwallowsSplitSequences(t *testing.T) {
3434 t .Run (fmt .Sprintf ("%q@%d" , seq , cut ), func (t * testing.T ) {
3535 m := testModel (t , newNodes ())
3636 require .Equal (t , fieldTitle , m .focusedField )
37- before := m .titleInput .Value ()
37+ before := m .titleArea .Value ()
3838
3939 for _ , msg := range splitSGRBurst (seq , cut ) {
4040 updated , _ := m .Update (msg )
4141 m = updated .(Model )
4242 }
4343
44- assert .Equal (t , before , m .titleInput .Value (), "no fragment should reach the title field" )
44+ assert .Equal (t , before , m .titleArea .Value (), "no fragment should reach the title field" )
4545 assert .False (t , m .mouseLeakActive , "the sequence resets once its terminator is consumed" )
4646
4747 // A normal keystroke afterwards must still register.
4848 m = sendKey (t , m , runeKey ('x' ))
49- assert .Equal (t , before + "x" , m .titleInput .Value (), "typing works after a swallowed sequence" )
49+ assert .Equal (t , before + "x" , m .titleArea .Value (), "typing works after a swallowed sequence" )
5050 })
5151 }
5252 }
@@ -56,45 +56,45 @@ func TestConsumeLeakedMouseKey_SwallowsSingleRunTail(t *testing.T) {
5656 // When the parser consumes "\x1b" as a lone Escape, the rest of the body can
5757 // arrive as one run.
5858 m := testModel (t , newNodes ())
59- before := m .titleInput .Value ()
59+ before := m .titleArea .Value ()
6060 m = sendKey (t , m , runeMsg ("[<65;54;51M" , false ))
61- assert .Equal (t , before , m .titleInput .Value (), "a whole leaked body in one run is dropped" )
61+ assert .Equal (t , before , m .titleArea .Value (), "a whole leaked body in one run is dropped" )
6262}
6363
6464func TestConsumeLeakedMouseKey_PreservesRealTyping (t * testing.T ) {
6565 m := testModel (t , newNodes ())
66- before := m .titleInput .Value ()
66+ before := m .titleArea .Value ()
6767
6868 // Characters from the mouse alphabet typed normally must pass through. Each
6969 // real keystroke is a single-rune message, never a complete SGR body.
7070 for _ , r := range []rune {'<' , '3' , ';' , '5' , 'M' , 'm' } {
7171 m = sendKey (t , m , runeKey (r ))
7272 }
73- assert .Equal (t , before + "<3;5Mm" , m .titleInput .Value (), "ordinary characters are never filtered" )
73+ assert .Equal (t , before + "<3;5Mm" , m .titleArea .Value (), "ordinary characters are never filtered" )
7474}
7575
7676func TestConsumeLeakedMouseKey_StrayAltBracketDoesNotEatNextKey (t * testing.T ) {
7777 m := testModel (t , newNodes ())
78- before := m .titleInput .Value ()
78+ before := m .titleArea .Value ()
7979
8080 // A lone Alt+"[" opens a sequence, but the following key is not a mouse body,
8181 // so it must still be handled (here: typed into the field).
8282 m = sendKey (t , m , runeMsg ("[" , true ))
8383 require .True (t , m .mouseLeakActive )
8484 m = sendKey (t , m , runeKey ('z' ))
8585 assert .False (t , m .mouseLeakActive , "a non-body rune ends the sequence" )
86- assert .Equal (t , before + "z" , m .titleInput .Value (), "the following real key is not eaten" )
86+ assert .Equal (t , before + "z" , m .titleArea .Value (), "the following real key is not eaten" )
8787}
8888
8989func TestConsumeLeakedMouseKey_BracketedPasteIsNotFiltered (t * testing.T ) {
9090 m := testModel (t , newNodes ())
91- before := m .titleInput .Value ()
91+ before := m .titleArea .Value ()
9292
9393 // A genuine paste that happens to look like a mouse body is preserved.
9494 paste := tea.KeyMsg {Type : tea .KeyRunes , Runes : []rune ("<65;54;51M" ), Paste : true }
9595 updated , _ := m .Update (paste )
9696 m = updated .(Model )
97- assert .Equal (t , before + "<65;54;51M" , m .titleInput .Value (), "pasted content is never filtered" )
97+ assert .Equal (t , before + "<65;54;51M" , m .titleArea .Value (), "pasted content is never filtered" )
9898}
9999
100100func TestConsumeLeakedMouseKey_DescriptionField (t * testing.T ) {
0 commit comments