elvish/pkg/cli/term/setup_unix_test.go
Qi Xiao 0adf0ec147 Use the unix build tag.
The unix build tag is supported by Go 1.19.
2023-03-03 00:01:26 +00:00

27 lines
493 B
Go

//go:build unix
package term
import (
"testing"
"github.com/creack/pty"
)
func TestSetupTerminal(t *testing.T) {
pty, tty, err := pty.Open()
if err != nil {
t.Skip("cannot open pty for testing setupTerminal")
}
defer pty.Close()
defer tty.Close()
_, err = setup(tty, 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.TermiosForFd(int(tty.Fd()))
}