From 4b19790092d689bb2eb5fa7ac297682564b59aaa Mon Sep 17 00:00:00 2001 From: Joe Kyo Date: Thu, 18 Feb 2021 18:37:11 +0800 Subject: [PATCH] txtar: minor fix in unit test input Change-Id: I7bb1caf63772a460206dd6ca0a35b11a61ca162f Reviewed-on: https://go-review.googlesource.com/c/tools/+/293531 Run-TryBot: Ian Lance Taylor gopls-CI: kokoro TryBot-Result: Go Bot Reviewed-by: Jay Conrod Trust: Jay Conrod Trust: Bryan C. Mills --- txtar/archive_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/txtar/archive_test.go b/txtar/archive_test.go index 1f79f8d112..7ac5ee9dd7 100644 --- a/txtar/archive_test.go +++ b/txtar/archive_test.go @@ -70,7 +70,7 @@ func TestFormat(t *testing.T) { {"file1", []byte("File 1 text.\n-- foo ---\nMore file 1 text.\n")}, {"file 2", []byte("File 2 text.\n")}, {"empty", []byte{}}, - {"noNL", []byte("hello world\n")}, + {"noNL", []byte("hello world")}, }, }, wanted: `comment1 @@ -90,7 +90,7 @@ hello world for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { result := Format(tt.input) - if !reflect.DeepEqual(string(result), tt.wanted) { + if string(result) != tt.wanted { t.Errorf("Wrong output. \nGot:\n%s\nWant:\n%s\n", string(result), tt.wanted) } })