Skip to content

Commit ba055cc

Browse files
Update test to be Abs and include function name in error output
1 parent 2ff9bde commit ba055cc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/testing/testing.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
// For more detail, run ``go help test'' and ``go help testflag''.
1919
//
2020
// A simple test function looks like this:
21-
// func TestHello(t *testing.T) {
22-
// got := fmt.Sprintf("hello %s", "world")
23-
// want := "hello world"
21+
// func TestAbs(t *testing.T) {
22+
// got := Abs(-1)
23+
// want := 1
2424
// if got != want {
25-
// t.Errorf("got %q, want %q", got, want)
25+
// t.Errorf("Abs(-1) returns %d, want %d", got, want)
2626
// }
2727
// }
2828
//

0 commit comments

Comments
 (0)