From c07023a37213c819afbccf7c5d5b42c95b9d4a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Thu, 17 Mar 2022 19:31:50 +0100 Subject: [PATCH] Skip vi-dependent tests when there is no vi in PATH (#397) --- survey_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/survey_test.go b/survey_test.go index 68c80eeb..d0d6230e 100644 --- a/survey_test.go +++ b/survey_test.go @@ -2,6 +2,7 @@ package survey import ( "errors" + "os/exec" "strings" "testing" "time" @@ -170,6 +171,10 @@ func TestPagination_lastHalf(t *testing.T) { } func TestAsk(t *testing.T) { + if _, err := exec.LookPath("vi"); err != nil { + t.Skip("vi not found in PATH") + } + tests := []struct { name string questions []*Question