elvish/pkg/edit/command_api_test.go
Qi Xiao 4fcffc5671 Remove most uses of the legacy assignment syntax.
The remaining few uses are in some of the tests, which will be removed later.

This addresses #645.
2022-01-03 00:47:41 +00:00

32 lines
537 B
Go

package edit
import (
"testing"
"src.elv.sh/pkg/cli/term"
"src.elv.sh/pkg/ui"
)
func TestCommandMode(t *testing.T) {
f := setup(t)
evals(f.Evaler, `set edit:insert:binding[Ctrl-'['] = $edit:command:start~`)
feedInput(f.TTYCtrl, "echo")
f.TTYCtrl.Inject(term.K('[', ui.Ctrl))
f.TestTTY(t,
"~> echo", Styles,
" vvvv", term.DotHere, "\n",
" COMMAND ", Styles,
"*********",
)
f.TTYCtrl.Inject(term.K('b'))
f.TestTTY(t,
"~> ", term.DotHere,
"echo\n", Styles,
"vvvv",
" COMMAND ", Styles,
"*********",
)
}