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 <iant@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Trust: Jay Conrod <jayconrod@google.com>
Trust: Bryan C. Mills <bcmills@google.com>
This commit is contained in:
Joe Kyo 2021-02-18 18:37:11 +08:00 committed by Jay Conrod
parent 9eb353543b
commit 4b19790092
1 changed files with 2 additions and 2 deletions

View File

@ -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)
}
})