Skip to content

Commit

Permalink
Change example code to follow "keep going" principle for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
just-an-engineer authored and just-an-engineer committed Aug 6, 2024
1 parent 04a44d2 commit ee8db1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _content/doc/tutorial/add-a-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
want := regexp.MustCompile(`\b`+name+`\b`)
msg, err := Hello("Gladys")
if !want.MatchString(msg) || err != nil {
t.Fatalf(`Hello("Gladys") = %q, %v, want match for %#q, nil`, msg, err, want)
t.Errorf(`Hello("Gladys") = %q, %v, want match for %#q, nil`, msg, err, want)
}
}

Expand All @@ -58,7 +58,7 @@
func TestHelloEmpty(t *testing.T) {
msg, err := Hello("")
if msg != "" || err == nil {
t.Fatalf(`Hello("") = %q, %v, want "", error`, msg, err)
t.Errorf(`Hello("") = %q, %v, want "", error`, msg, err)
}
}
</pre
Expand Down

0 comments on commit ee8db1c

Please sign in to comment.