mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 09:57:51 +08:00
0adf0ec147
The unix build tag is supported by Go 1.19.
27 lines
493 B
Go
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()))
|
|
}
|