Skip to content

Commit e15765a

Browse files
committed
ci: re-enable windows test coverage
1 parent e2c35cb commit e15765a

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/go.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ jobs:
4848
run: go build -v ./...
4949
shell: powershell
5050

51-
# - name: Run coverage
52-
# run: go test -v ./...
53-
# shell: powershell
51+
- name: Run coverage
52+
run: go test -v ./...
53+
shell: powershell

inputrc/inputrc_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ func readTest(t *testing.T, name string) [][]byte {
186186
t.Fatalf("expected no error, got: %v", err)
187187
}
188188

189+
// Correct for Windows line endings, as test files are embedded.
190+
buf = bytes.ReplaceAll(buf, []byte("\r\n"), []byte("\n"))
191+
189192
return bytes.Split(buf, []byte(delimiter))
190193
}
191194

@@ -391,6 +394,9 @@ func readTestdata(name string) ([]byte, error) {
391394
return nil, err
392395
}
393396

397+
// Correct for Windows line endings, as test files are embedded.
398+
buf = bytes.ReplaceAll(buf, []byte("\r\n"), []byte("\n"))
399+
394400
v := bytes.Split(buf, []byte(delimiter))
395401
if len(v) != 3 {
396402
return nil, fmt.Errorf("test data %s is invalid", name)
@@ -400,4 +406,4 @@ func readTestdata(name string) ([]byte, error) {
400406
}
401407

402408
//go:embed testdata/*.inputrc
403-
var testdata embed.FS
409+
var testdata embed.FS

0 commit comments

Comments
 (0)