elvish/pkg/edit/minibuf_test.go
Qi Xiao e9d328aa16 Make use of (*testing.T).Cleanup for test cleanups.
This allows turning the following pattern in tests:

  value, cleanup := setupSomething()
  defer cleanup()

into the following:

  value := setupSomething(t)
2021-08-06 23:21:23 +01:00

24 lines
350 B
Go

package edit
import (
"testing"
"src.elv.sh/pkg/cli/term"
)
func TestMinibuf(t *testing.T) {
f := setup(t)
evals(f.Evaler, `edit:minibuf:start`)
f.TestTTY(t,
"~> \n",
" MINIBUF ", Styles,
"********* ", term.DotHere,
)
feedInput(f.TTYCtrl, "edit:insert-at-dot put\n")
f.TestTTY(t,
"~> put", Styles,
" vvv", term.DotHere,
)
}