Skip to content

Commit

Permalink
Added test to check for $1 in Get function
Browse files Browse the repository at this point in the history
  • Loading branch information
danbopes committed Feb 8, 2015
1 parent 69738bd commit a7d6764
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sqlx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,16 @@ func TestUsage(t *testing.T) {
jason = Person{}
err = db.Get(&jason, db.Rebind("SELECT * FROM person WHERE first_name=?"), "Jason")

if err != nil {
t.Fatal(err)
}
if jason.FirstName != "Jason" {
t.Errorf("Expecting to get back Jason, but got %v\n", jason.FirstName)
}

jason = Person{}
err = db.Get(&jason, db.Rebind("SELECT * FROM person WHERE first_name=$1"), "Jason")

if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit a7d6764

Please sign in to comment.