mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-15 03:37:52 +08:00
edit: Add a very basic test against setupTerminal.
This commit is contained in:
parent
c1fa531ac8
commit
c48dc45bdc
24
edit/editor_test.go
Normal file
24
edit/editor_test.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
package edit
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/kr/pty"
|
||||
)
|
||||
|
||||
func TestSetupTerminal(t *testing.T) {
|
||||
pty, tty, err := pty.Open()
|
||||
if err != nil {
|
||||
t.Errorf("cannot open pty for testing setupTerminal")
|
||||
}
|
||||
defer pty.Close()
|
||||
defer tty.Close()
|
||||
|
||||
_, err = setupTerminal(tty)
|
||||
if err != nil {
|
||||
t.Errorf("setupTerminal returns an error")
|
||||
}
|
||||
// TODO(xiaq): Test whether the interesting flags in the termios were indeed
|
||||
// set.
|
||||
// termios, err := sys.NewTermiosFromFd(int(tty.Fd()))
|
||||
}
|
Loading…
Reference in New Issue
Block a user