Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion query.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func stripQuery(q string) (s string) {

// QueryMatcher is an SQL query string matcher interface,
// which can be used to customize validation of SQL query strings.
// As an exaple, external library could be used to build
// As an example, external library could be used to build
// and validate SQL ast, columns selected.
//
// sqlmock can be customized to implement a different QueryMatcher
Expand Down
6 changes: 3 additions & 3 deletions result_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ func TestShouldReturnValidSqlDriverResult(t *testing.T) {
result := NewResult(1, 2)
id, err := result.LastInsertId()
if 1 != id {
t.Errorf("Expected last insert id to be 1, but got: %d", id)
t.Errorf("expected last insert id to be 1, but got: %d", id)
}
if err != nil {
t.Errorf("expected no error, but got: %s", err)
}
affected, err := result.RowsAffected()
if 2 != affected {
t.Errorf("Expected affected rows to be 2, but got: %d", affected)
t.Errorf("expected affected rows to be 2, but got: %d", affected)
}
if err != nil {
t.Errorf("expected no error, but got: %s", err)
}
}

func TestShouldReturnErroeSqlDriverResult(t *testing.T) {
func TestShouldReturnErrorSqlDriverResult(t *testing.T) {
result := NewErrorResult(fmt.Errorf("some error"))
_, err := result.LastInsertId()
if err == nil {
Expand Down
2 changes: 1 addition & 1 deletion rows.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// CSVColumnParser is a function which converts trimmed csv
// column string to a []byte representation. currently
// column string to a []byte representation. Currently
// transforms NULL to nil
var CSVColumnParser = func(s string) []byte {
switch {
Expand Down
2 changes: 1 addition & 1 deletion sqlmock.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (c *sqlmock) MatchExpectationsInOrder(b bool) {
}

// Close a mock database driver connection. It may or may not
// be called depending on the sircumstances, but if it is called
// be called depending on the circumstances, but if it is called
// there must be an *ExpectedClose expectation satisfied.
// meets http://golang.org/pkg/database/sql/driver/#Conn interface
func (c *sqlmock) Close() error {
Expand Down
8 changes: 4 additions & 4 deletions sqlmock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func TestMockQuery(t *testing.T) {

defer func() {
if er := rows.Close(); er != nil {
t.Error("Unexpected error while trying to close rows")
t.Error("unexpected error while trying to close rows")
}
}()

Expand Down Expand Up @@ -167,7 +167,7 @@ func TestMockQueryTypes(t *testing.T) {
}
defer func() {
if er := rows.Close(); er != nil {
t.Error("Unexpected error while trying to close rows")
t.Error("unexpected error while trying to close rows")
}
}()
if !rows.Next() {
Expand Down Expand Up @@ -615,7 +615,7 @@ func TestArgumentReflectValueTypeError(t *testing.T) {

_, err = db.Query("SELECT * FROM sales WHERE x = ?", 5)
if err == nil {
t.Error("Expected error, but got none")
t.Error("expected error, but got none")
}
}

Expand Down Expand Up @@ -782,7 +782,7 @@ func TestEmptyRowSet(t *testing.T) {

defer func() {
if er := rows.Close(); er != nil {
t.Error("Unexpected error while trying to close rows")
t.Error("unexpected error while trying to close rows")
}
}()

Expand Down
4 changes: 2 additions & 2 deletions statement_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
)

func TestExpectedPreparedStatemtCloseError(t *testing.T) {
func TestExpectedPreparedStatementCloseError(t *testing.T) {
conn, mock, err := New()
if err != nil {
t.Fatal("failed to open sqlmock database:", err)
Expand All @@ -28,6 +28,6 @@ func TestExpectedPreparedStatemtCloseError(t *testing.T) {
}

if err := stmt.Close(); err != want {
t.Fatalf("Got = %v, want = %v", err, want)
t.Fatalf("got = %v, want = %v", err, want)
}
}
1 change: 0 additions & 1 deletion stubs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ func (ni *NullInt) Scan(value interface{}) error {
ni.Integer, ni.Valid = 0, false
case int64:
const maxUint = ^uint(0)
const minUint = 0
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused

const maxInt = int(maxUint >> 1)
const minInt = -maxInt - 1

Expand Down