restic/internal/ui/termstatus/background_unix_test.go

23 lines
339 B
Go
Raw Normal View History

//go:build unix
package termstatus
import (
"os"
"testing"
rtest "github.com/restic/restic/internal/test"
)
func TestIsProcessBackground(t *testing.T) {
tty, err := os.Open("/dev/tty")
if err != nil {
t.Skipf("can't open terminal: %v", err)
}
_, err = isProcessBackground(int(tty.Fd()))
rtest.OK(t, err)
2021-01-30 19:35:46 +01:00
_ = tty.Close()
}