You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// wait until the prompt is rendered and send the Enter key
75
+
gofunc() {
76
+
pty.WaitForOutput("Body")
77
+
assert.Equal(t, "\x1b[0G\x1b[2K\x1b[0;1;92m? \x1b[0m\x1b[0;1;99mBody \x1b[0m\x1b[0;36m[(e) to launch vim, enter to skip] \x1b[0m\x1b[?25l", pty.Output())
// wait until the prompt is rendered and send the 'e' key
54
106
gofunc() {
55
-
r, err:=e.Prompt(defaultPromptConfig())
56
-
ifr!=nil {
57
-
res=r.(string)
58
-
}
59
-
errc<-err
107
+
pty.WaitForOutput("Body")
108
+
assert.Equal(t, "\x1b[0G\x1b[2K\x1b[0;1;92m? \x1b[0m\x1b[0;1;99mBody \x1b[0m\x1b[0;36m[(e) to launch vim, enter to skip] \x1b[0m\x1b[?25l", pty.Output())
109
+
pty.ResetOutput()
110
+
assert.NoError(t, pty.SendKey('e'))
60
111
}()
61
112
62
-
for {
63
-
time.Sleep(time.Millisecond)
64
-
ifstrings.Contains(out.String(), "Body") {
65
-
break
66
-
}
113
+
res, err:=e.Prompt(defaultPromptConfig())
114
+
assert.NoError(t, err)
115
+
assert.Equal(t, "initial value - added by vim", res)
assert.Equal(t, "\x1b[0G\x1b[2K\x1b[0;1;92m? \x1b[0m\x1b[0;1;99mBody \x1b[0m\x1b[0;36m[(e) to launch false, enter to skip] \x1b[0m\x1b[?25l", out.String())
70
-
out.Reset()
71
-
fmt.Fprint(pty, "\n") // send Enter key
136
+
// wait until the prompt is rendered and send the 'e' key
137
+
gofunc() {
138
+
pty.WaitForOutput("Body")
139
+
assert.Equal(t, "\x1b[0G\x1b[2K\x1b[0;1;92m? \x1b[0m\x1b[0;1;99mBody \x1b[0m\x1b[0;36m[(e) to launch nano, enter to skip] \x1b[0m\x1b[?25l", pty.Output())
0 commit comments