Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbbe4726

Browse files
aiskncw
authored andcommitted
pytest: ensure expected string's line sep is \n
1 parent8b4dffb commitbbe4726

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

‎main_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ func TestGPython(t *testing.T) {
4848
}
4949

5050
want,err:=os.ReadFile(fname)
51+
want=bytes.ReplaceAll(want, []byte("\r\n"), []byte("\n"))
5152
iferr!=nil {
5253
t.Fatalf("could not read golden file: %+v",err)
5354
}

‎pytest/pytest.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ func (task *Task) run() error {
273273
returnfmt.Errorf("could not read golden output %q: %w",task.GoldFile,err)
274274
}
275275

276+
want=bytes.ReplaceAll(want, []byte("\r\n"), []byte("\n"))
276277
diff:=cmp.Diff(string(want),string(got))
277278
if!bytes.Equal(got,want) {
278279
out:=fileBase+".txt"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp