From 92c09d6b7911fef1f3c0a04f5c79104a96348855 Mon Sep 17 00:00:00 2001 From: Tom Fleet Date: Sun, 5 Nov 2023 13:23:05 +0000 Subject: [PATCH] Add README entry about test.File --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 1786a5d..8180bcd 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,10 @@ func TestSomething(t *testing.T) { // Get $CWD/testdata easily test.Data(t) // /Users/you/project/package/testdata + // Check against contents of a file (relative to $CWD/testdata) + // including line ending normalisation + test.File(t, "expected.txt", "hello\n") + // Just like the good old reflect.DeepEqual, but with a nicer format test.DeepEqual(t, []string{"hello"}, []string{"world"}) // Fails }