From 6bf77c4d54086d3502b0a96cc8e739deb5487025 Mon Sep 17 00:00:00 2001 From: AN Long Date: Sat, 5 Jul 2025 00:04:12 +0900 Subject: [PATCH] pytest: ensure expected string's line sep is \n --- main_test.go | 1 + pytest/pytest.go | 1 + 2 files changed, 2 insertions(+) diff --git a/main_test.go b/main_test.go index e41ed869..f6347fda 100644 --- a/main_test.go +++ b/main_test.go @@ -48,6 +48,7 @@ func TestGPython(t *testing.T) { } want, err := os.ReadFile(fname) + want = bytes.ReplaceAll(want, []byte("\r\n"), []byte("\n")) if err != nil { t.Fatalf("could not read golden file: %+v", err) } diff --git a/pytest/pytest.go b/pytest/pytest.go index 7c331d26..d00f7fb0 100644 --- a/pytest/pytest.go +++ b/pytest/pytest.go @@ -273,6 +273,7 @@ func (task *Task) run() error { return fmt.Errorf("could not read golden output %q: %w", task.GoldFile, err) } + want = bytes.ReplaceAll(want, []byte("\r\n"), []byte("\n")) diff := cmp.Diff(string(want), string(got)) if !bytes.Equal(got, want) { out := fileBase + ".txt" pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy