restic/internal/ui/termstatus/background_linux_test.go
2021-01-30 20:19:47 +01:00

20 lines
317 B
Go

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(tty.Fd())
rtest.OK(t, err)
_ = tty.Close()
}