mirror of
https://github.com/neilotoole/sq.git
synced 2024-12-18 21:52:28 +03:00
fab365f43c
* gofumpt on files * more gofumpt
32 lines
621 B
Go
32 lines
621 B
Go
package sqlite3
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
var (
|
|
KindFromDBTypeName = kindFromDBTypeName
|
|
GetTblRowCounts = getTblRowCounts
|
|
)
|
|
|
|
func TestPlaceholders(t *testing.T) {
|
|
testCases := []struct {
|
|
numCols int
|
|
numRows int
|
|
want string
|
|
}{
|
|
{numCols: 0, numRows: 0, want: ""},
|
|
{numCols: 1, numRows: 1, want: "(?)"},
|
|
{numCols: 2, numRows: 1, want: "(?, ?)"},
|
|
{numCols: 1, numRows: 2, want: "(?), (?)"},
|
|
{numCols: 2, numRows: 2, want: "(?, ?), (?, ?)"},
|
|
}
|
|
|
|
for _, tc := range testCases {
|
|
got := placeholders(tc.numCols, tc.numRows)
|
|
require.Equal(t, tc.want, got)
|
|
}
|
|
}
|