mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-01 08:42:55 +08:00
4fcffc5671
The remaining few uses are in some of the tests, which will be removed later. This addresses #645.
32 lines
537 B
Go
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,
|
|
"*********",
|
|
)
|
|
}
|