Skip to content

Commit

Permalink
merger测试修改
Browse files Browse the repository at this point in the history
  • Loading branch information
juniaoshaonian committed Mar 13, 2023
1 parent 085981b commit a4e3c3c
Show file tree
Hide file tree
Showing 7 changed files with 510 additions and 209 deletions.
5 changes: 5 additions & 0 deletions internal/merger/batchmerger/merger.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,8 @@ func (m *MergerRows) Close() error {
func (m *MergerRows) Columns() ([]string, error) {
return m.rows[0].Columns()
}

// Err 等会实现
func (m *MergerRows) Err() error {
return nil
}
2 changes: 1 addition & 1 deletion internal/merger/batchmerger/merger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"

"github.com/DATA-DOG/go-sqlmock"
"github.com/ecodeclub/eorm/internal/errs"
"github.com/ecodeclub/eorm/internal/merger/internal/errs"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
Expand Down
8 changes: 5 additions & 3 deletions internal/merger/internal/errs/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ import (
)

var (
ErrEmptySortColumns = errors.New("merger: 排序列为空")
ErrMergerEmptyRows = errors.New("eorm: sql.Rows列表为空")
ErrMergerRowsIsNull = errors.New("eorm: sql.Rows列表中有元素为nil")
ErrEmptySortColumns = errors.New("merger: 排序列为空")
ErrMergerEmptyRows = errors.New("merger: sql.Rows列表为空")
ErrMergerRowsIsNull = errors.New("merger: sql.Rows列表中有元素为nil")
ErrMergerScanNotNext = errors.New("merger: Scan called without calling Next")
ErrMergerScanClosed = errors.New("merger: Scan Rows Closed")
)

func NewRepeatSortColumn(column string) error {
Expand Down
Loading

0 comments on commit a4e3c3c

Please sign in to comment.