Skip to content

Commit

Permalink
add more error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
jonbodner committed Nov 30, 2020
1 parent ea1f026 commit 2102934
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion solver/solver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ func TestProcessor_ProcessExpressions(t *testing.T) {
( 2 + 2 * 10`)
data := []float64{22, 40, 0, 0}
for _, d := range data {
result, _ := p.ProcessExpression(context.Background(), in)
result, err := p.ProcessExpression(context.Background(), in)
if err != nil {
t.Error(err)
}
if result != d {
t.Errorf("Expected result %f, got %f", d, result)
}
Expand Down
5 changes: 4 additions & 1 deletion stub/stub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ func TestLogicGetPetNames(t *testing.T) {
l := Logic{GetPetNamesStub{}}
for _, d := range data {
t.Run(d.name, func(t *testing.T) {
petNames, _ := l.GetPetNames(d.userID)
petNames, err := l.GetPetNames(d.userID)
if err != nil {
t.Error(err)
}
if diff := cmp.Diff(d.petNames, petNames); diff != "" {
t.Error(diff)
}
Expand Down

0 comments on commit 2102934

Please sign in to comment.