You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this test checks if an existing word is being added again, if it is a new word it should return a nil error, in order to check that the following call to an assertion function is made:
assertError(t, err, nil)
That function is previously written as:
func assertError(t *testing.T, got, want error) {
t.Helper()
if got == nil {
t.Fatal("expected to get an error.")
}
if got != want {
t.Errorf("got error %q want %q", got, want)
}
}
which will always throw a fatal error since we are passing nil as the got parameter.
The text was updated successfully, but these errors were encountered:
If you follow the maps chapter, there is a point where you are stuck in an error not addressed in the tutorial.
After you write the TestAdd test the second time: https://github.com/quii/learn-go-with-tests/blob/master/maps.md#write-the-test-first-3
this test checks if an existing word is being added again, if it is a new word it should return a nil error, in order to check that the following call to an assertion function is made:
That function is previously written as:
which will always throw a fatal error since we are passing nil as the
got
parameter.The text was updated successfully, but these errors were encountered: