From fc8c5fdce62fb229202659408798a7b6c98f6e8b Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Fri, 28 Apr 2023 01:36:55 +0800 Subject: --- cli/internal/ui/term/cursor_test.go | 43 ------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 cli/internal/ui/term/cursor_test.go (limited to 'cli/internal/ui/term/cursor_test.go') diff --git a/cli/internal/ui/term/cursor_test.go b/cli/internal/ui/term/cursor_test.go deleted file mode 100644 index 270ebe8..0000000 --- a/cli/internal/ui/term/cursor_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build !windows -// +build !windows - -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 -package cursor - -import ( - "io" - "strings" - "testing" - - "github.com/AlecAivazis/survey/v2/terminal" - "github.com/stretchr/testify/require" -) - -func TestEraseLine(t *testing.T) { - testCases := map[string]struct { - inWriter func(writer io.Writer) terminal.FileWriter - shouldErase bool - }{ - "should erase a line if the writer is a file": { - inWriter: func(writer io.Writer) terminal.FileWriter { - return &fakeFileWriter{w: writer} - }, - shouldErase: true, - }, - } - - for name, tc := range testCases { - t.Run(name, func(t *testing.T) { - // GIVEN - buf := new(strings.Builder) - - // WHEN - EraseLine(tc.inWriter(buf)) - - // THEN - isErased := buf.String() != "" - require.Equal(t, tc.shouldErase, isErased) - }) - } -} -- cgit v1.2.3-70-g09d2