Skip to content

Commit

Permalink
Fix a code snippet for failing test
Browse files Browse the repository at this point in the history
* replace `t.Error` with `t.Fatal`, so that the test stops, if we don't have an error;
* replace `got` with `err`, as `err` is the actual object we can call `Error()` on, here `got` is not defined
  • Loading branch information
AlexVPopov authored Jul 22, 2018
1 parent 276500b commit 10a7209
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ func TestSearch(t *testing.T) {
want := "could not find the word you were looking for"

if err == nil {
t.Error("expected to get an error.")
t.Fatal("expected to get an error.")
}

assertStrings(t, got.Error(), want)
assertStrings(t, err.Error(), want)
})
}
```
Expand Down

0 comments on commit 10a7209

Please sign in to comment.