FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
squirrel/insert_ctx_test.go at master · Masterminds/squirrel · GitHub
Masterminds
/
squirrel
Public
Notifications
You must be signed in to change notification settings
Fork
511
Star
8k
Code
Issues
69
Pull requests
28
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
squirrel
/
insert_ctx_test.go
Copy path
More file actions
More file actions
Latest commit
History
History
History
41 lines (28 loc) · 807 Bytes
Breadcrumbs
squirrel
/
insert_ctx_test.go
Copy path
File metadata and controls
41 lines (28 loc) · 807 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// +build go1.8
package
squirrel
import
(
"testing"
"github.com/stretchr/testify/assert"
)
func
TestInsertBuilderContextRunners
(
t
*
testing.
T
) {
db
:=
&
DBStub
{}
b
:=
Insert
(
"test"
).
Values
(
1
).
RunWith
(
db
)
expectedSql
:=
"INSERT INTO test VALUES (?)"
b
.
ExecContext
(
ctx
)
assert
.
Equal
(
t
,
expectedSql
,
db
.
LastExecSql
)
b
.
QueryContext
(
ctx
)
assert
.
Equal
(
t
,
expectedSql
,
db
.
LastQuerySql
)
b
.
QueryRowContext
(
ctx
)
assert
.
Equal
(
t
,
expectedSql
,
db
.
LastQueryRowSql
)
err
:=
b
.
ScanContext
(
ctx
)
assert
.
NoError
(
t
,
err
)
}
func
TestInsertBuilderContextNoRunner
(
t
*
testing.
T
) {
b
:=
Insert
(
"test"
).
Values
(
1
)
_
,
err
:=
b
.
ExecContext
(
ctx
)
assert
.
Equal
(
t
,
RunnerNotSet
,
err
)
_
,
err
=
b
.
QueryContext
(
ctx
)
assert
.
Equal
(
t
,
RunnerNotSet
,
err
)
err
=
b
.
ScanContext
(
ctx
)
assert
.
Equal
(
t
,
RunnerNotSet
,
err
)
}
Back
|
FazBrowse Home
|
New Git URL