A lightweight test helper package
0

Configure Feed

Select the types of activity you want to include in your feed.

Document line comment

Tom Fleet (Oct 18, 2024, 4:09 PM +0100) dfcced39 597eb1ea

+25
+21
README.md
··· 55 55 } 56 56 ``` 57 57 58 + ### Self Documenting Tests 59 + 58 60 > [!TIP] 59 61 > Line comments on the line you call most `test` functions on will be shown in failure messages as additional context 62 + 63 + That means you can have additional context in the failure message, as well as helpful comments explaining the assertion to readers of your code 64 + 65 + ```go 66 + func TestSomething(t *testing.T) { 67 + test.Equal(t, "apples", "oranges") // Fruits are not equal 68 + } 69 + ``` 70 + 71 + Will get you a failure message like: 72 + 73 + ```shell 74 + --- FAIL: TestSomething (0.00s) 75 + something_test.go:1: 76 + Not Equal // Fruits are not equal 77 + --------- 78 + Got: apples 79 + Wanted: oranges 80 + ``` 60 81 61 82 ### Non Comparable Types 62 83
+4
test_test.go
··· 578 578 test.Equal(t, stderr, "") 579 579 }) 580 580 } 581 + 582 + func TestSomething(t *testing.T) { 583 + test.Equal(t, "apples", "oranges") // Fruits are not equal 584 + }