Skip to content

Commit 71626bf

Browse files
committed
Account for Windows
1 parent b27ac1e commit 71626bf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

grpc/codegen/proto_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package codegen
22

33
import (
4+
"runtime"
5+
"strings"
46
"testing"
57

68
"github.com/stretchr/testify/assert"
@@ -42,6 +44,9 @@ func TestProtoFiles(t *testing.T) {
4244
sections := fs[0].SectionTemplates
4345
require.GreaterOrEqual(t, len(sections), 3)
4446
code := sectionCode(t, sections[1:]...)
47+
if runtime.GOOS == "windows" {
48+
c.Code = strings.ReplaceAll(c.Code, "\n", "\r\n")
49+
}
4550
assert.Equal(t, code, c.Code)
4651
fpath := codegen.CreateTempFile(t, code)
4752
assert.NoError(t, protoc(fpath, nil), "error occurred when compiling proto file %q", fpath)

0 commit comments

Comments
 (0)