@@ -89,21 +89,21 @@ func TestStmt(t *testing.T) {
89
89
t .Fatal (err )
90
90
}
91
91
92
- if err := stmt .BindBlob (1 , [] byte ( "" ) ); err != nil {
92
+ if err := stmt .BindRawText (1 , nil ); err != nil {
93
93
t .Fatal (err )
94
94
}
95
95
if err := stmt .Exec (); err != nil {
96
96
t .Fatal (err )
97
97
}
98
98
99
- if err := stmt .BindBlob (1 , []byte ("blob " )); err != nil {
99
+ if err := stmt .BindBlob (1 , []byte ("" )); err != nil {
100
100
t .Fatal (err )
101
101
}
102
102
if err := stmt .Exec (); err != nil {
103
103
t .Fatal (err )
104
104
}
105
105
106
- if err := stmt .BindBlob (1 , nil ); err != nil {
106
+ if err := stmt .BindBlob (1 , [] byte ( "blob" ) ); err != nil {
107
107
t .Fatal (err )
108
108
}
109
109
if err := stmt .Exec (); err != nil {
@@ -354,8 +354,8 @@ func TestStmt(t *testing.T) {
354
354
}
355
355
356
356
if stmt .Step () {
357
- if got := stmt .ColumnType (0 ); got != sqlite3 .BLOB {
358
- t .Errorf ("got %v, want BLOB " , got )
357
+ if got := stmt .ColumnType (0 ); got != sqlite3 .TEXT {
358
+ t .Errorf ("got %v, want TEXT " , got )
359
359
}
360
360
if got := stmt .ColumnBool (0 ); got != false {
361
361
t .Errorf ("got %v, want false" , got )
@@ -391,11 +391,11 @@ func TestStmt(t *testing.T) {
391
391
if got := stmt .ColumnFloat (0 ); got != 0 {
392
392
t .Errorf ("got %v, want zero" , got )
393
393
}
394
- if got := stmt .ColumnText (0 ); got != "blob " {
395
- t .Errorf (` got %q, want "blob"` , got )
394
+ if got := stmt .ColumnText (0 ); got != "" {
395
+ t .Errorf (" got %q, want empty" , got )
396
396
}
397
- if got := stmt .ColumnBlob (0 , nil ); string ( got ) != "blob" {
398
- t .Errorf (` got %q, want "blob"` , got )
397
+ if got := stmt .ColumnBlob (0 , nil ); got != nil {
398
+ t .Errorf (" got %q, want nil" , got )
399
399
}
400
400
var got any
401
401
if err := stmt .ColumnJSON (0 , & got ); err == nil {
@@ -404,8 +404,8 @@ func TestStmt(t *testing.T) {
404
404
}
405
405
406
406
if stmt .Step () {
407
- if got := stmt .ColumnType (0 ); got != sqlite3 .NULL {
408
- t .Errorf ("got %v, want NULL " , got )
407
+ if got := stmt .ColumnType (0 ); got != sqlite3 .BLOB {
408
+ t .Errorf ("got %v, want BLOB " , got )
409
409
}
410
410
if got := stmt .ColumnBool (0 ); got != false {
411
411
t .Errorf ("got %v, want false" , got )
@@ -416,17 +416,15 @@ func TestStmt(t *testing.T) {
416
416
if got := stmt .ColumnFloat (0 ); got != 0 {
417
417
t .Errorf ("got %v, want zero" , got )
418
418
}
419
- if got := stmt .ColumnText (0 ); got != "" {
420
- t .Errorf (" got %q, want empty" , got )
419
+ if got := stmt .ColumnText (0 ); got != "blob " {
420
+ t .Errorf (` got %q, want "blob"` , got )
421
421
}
422
- if got := stmt .ColumnBlob (0 , nil ); got != nil {
423
- t .Errorf (" got %q, want nil" , got )
422
+ if got := stmt .ColumnBlob (0 , nil ); string ( got ) != "blob" {
423
+ t .Errorf (` got %q, want "blob"` , got )
424
424
}
425
- var got any = 1
426
- if err := stmt .ColumnJSON (0 , & got ); err != nil {
427
- t .Error (err )
428
- } else if got != nil {
429
- t .Errorf ("got %v, want NULL" , got )
425
+ var got any
426
+ if err := stmt .ColumnJSON (0 , & got ); err == nil {
427
+ t .Errorf ("got %v, want error" , got )
430
428
}
431
429
}
432
430
0 commit comments