@@ -2,6 +2,7 @@ package errors
22
33import (
44 "bytes"
5+ "errors"
56 "fmt"
67 "io"
78 "reflect"
@@ -16,6 +17,7 @@ func TestNew(t *testing.T) {
1617 {"" , fmt .Errorf ("" )},
1718 {"foo" , fmt .Errorf ("foo" )},
1819 {"foo" , New ("foo" )},
20+ {"string with format specifiers: %v" , errors .New ("string with format specifiers: %v" )},
1921 }
2022
2123 for _ , tt := range tests {
@@ -121,13 +123,13 @@ func TestFprint(t *testing.T) {
121123 want : "cause error\n EOF\n " ,
122124 }, {
123125 err : x , // return from errors.New
124- want : "github.com/pkg/errors/errors_test.go:104 : error\n " ,
126+ want : "github.com/pkg/errors/errors_test.go:106 : error\n " ,
125127 }, {
126128 err : Wrap (x , "message" ),
127- want : "github.com/pkg/errors/errors_test.go:126 : message\n github.com/pkg/errors/errors_test.go:104 : error\n " ,
129+ want : "github.com/pkg/errors/errors_test.go:128 : message\n github.com/pkg/errors/errors_test.go:106 : error\n " ,
128130 }, {
129131 err : Wrap (Wrap (x , "message" ), "another message" ),
130- want : "github.com/pkg/errors/errors_test.go:129 : another message\n github.com/pkg/errors/errors_test.go:129 : message\n github.com/pkg/errors/errors_test.go:104 : error\n " ,
132+ want : "github.com/pkg/errors/errors_test.go:131 : another message\n github.com/pkg/errors/errors_test.go:131 : message\n github.com/pkg/errors/errors_test.go:106 : error\n " ,
131133 }}
132134
133135 for i , tt := range tests {
0 commit comments