Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(618)

Unified Diff: src/pkg/database/sql/sql_test.go

Issue 43510044: code review 43510044: database/sql: let drivers access their own driver.Rows.
Patch Set: diff -r 7e1a4e190b02 https://code.google.com/p/go Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/database/sql/sql.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/database/sql/sql_test.go
===================================================================
--- a/src/pkg/database/sql/sql_test.go
+++ b/src/pkg/database/sql/sql_test.go
@@ -1861,6 +1861,23 @@
wg.Wait()
}
+func TestInspect(t *testing.T) {
+ if inspectStruct == nil {
+ t.Errorf("inspect was not set")
+ }
+ nativeRow := &rowsCursor{}
+ sqlRows := &Rows{rowsi: nativeRow}
+ sqlRow := &Row{rows: sqlRows}
+ rows, err := inspectStruct(sqlRows)
+ if err != nil || rows != nativeRow {
+ t.Errorf("inspect failed for *Rows")
+ }
+ rows, err = inspectStruct(sqlRow)
+ if err != nil || rows != nativeRow {
+ t.Errorf("inspect failed for *Row")
+ }
+}
+
func BenchmarkConcurrentDBExec(b *testing.B) {
b.ReportAllocs()
ct := new(concurrentDBExecTest)
« no previous file with comments | « src/pkg/database/sql/sql.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b