Skip to content

Commit

Permalink
add test for Save on invalid table
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvankooten committed Aug 8, 2018
1 parent 729fcb4 commit 9b563b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions loadsave_test.go
Expand Up @@ -104,6 +104,11 @@ func TestSave(t *testing.T) {
if err != nil {
t.Errorf("DB error on begin: %v", err)
}
// test invalid table for err return value
if err := Save(tx, "invalid_table_name", chris); err == nil {
t.Error("Save with invalid table, expected err, got nil")
}
// save correctly
if err = Save(tx, "person", chris); err != nil {
t.Errorf("DB error on Save: %v", err)
}
Expand Down

0 comments on commit 9b563b9

Please sign in to comment.