Skip to content

Instantly share code, notes, and snippets.

@zombiezen
Created February 22, 2018 18:52
Show Gist options
  • Save zombiezen/aece2186ae85f28dfa353d8facd37366 to your computer and use it in GitHub Desktop.
Save zombiezen/aece2186ae85f28dfa353d8facd37366 to your computer and use it in GitHub Desktop.
An example application that uses a contacts library with a brittle test.
package app
import "contacts"
func GreatSpeaker() *Person {
return contacts.Me()
}
func TestMyName(t *testing.T) {
got := GreatSpeaker()
want := &Person{
FirstName: "Ross",
LastName: "Light",
}
if !reflect.DeepEqual(got, want) {
t.Errorf("got %+v; want %+v", got, want)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment