aboutsummaryrefslogtreecommitdiffstats
path: root/commands/bug/bug_comment_test.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2023-01-17 22:05:29 +0100
committerGitHub <noreply@github.com>2023-01-17 22:05:29 +0100
commit0290091317deb9e6c0ff99f9217065168620d2f0 (patch)
treeef4b86e5b4ea357f43685f58a9d2f19bac5e8b3a /commands/bug/bug_comment_test.go
parente689cc506775ec1daccaae9ec35c7a28b48b2f05 (diff)
parentf23a7f07cc9d7e9b9407e0fcb99de6904f1b52a8 (diff)
downloadgit-bug-0290091317deb9e6c0ff99f9217065168620d2f0.tar.gz
Merge pull request #993 from MichaelMure/cmd-adapt
command: adapt the output of the bug list to the terminal size
Diffstat (limited to 'commands/bug/bug_comment_test.go')
-rw-r--r--commands/bug/bug_comment_test.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/commands/bug/bug_comment_test.go b/commands/bug/bug_comment_test.go
index c1dc9952..5625f1be 100644
--- a/commands/bug/bug_comment_test.go
+++ b/commands/bug/bug_comment_test.go
@@ -2,7 +2,7 @@ package bugcmd
import (
"fmt"
- "io/ioutil"
+ "os"
"strings"
"testing"
"time"
@@ -10,7 +10,6 @@ import (
"github.com/stretchr/testify/require"
"github.com/MichaelMure/git-bug/commands/bug/testenv"
- "github.com/MichaelMure/git-bug/commands/cmdtest"
"github.com/MichaelMure/git-bug/commands/execenv"
)
@@ -143,7 +142,7 @@ func requireCommentsEqual(t *testing.T, golden string, env *execenv.Env) {
t.Log("Got here")
for i, comment := range comments {
fileName := fmt.Sprintf(goldenFilePattern, golden, i)
- require.NoError(t, ioutil.WriteFile(fileName, []byte(comment.message), 0644))
+ require.NoError(t, os.WriteFile(fileName, []byte(comment.message), 0644))
}
}
@@ -157,7 +156,7 @@ func requireCommentsEqual(t *testing.T, golden string, env *execenv.Env) {
require.Equal(t, date.Add(time.Duration(i)*time.Minute), comment.date)
fileName := fmt.Sprintf(goldenFilePattern, golden, i)
- exp, err := ioutil.ReadFile(fileName)
+ exp, err := os.ReadFile(fileName)
require.NoError(t, err)
require.Equal(t, strings.ReplaceAll(string(exp), "\r", ""), strings.ReplaceAll(comment.message, "\r", ""))
}