@@ -89,21 +89,21 @@ func TestStmt(t *testing.T) {
8989 t .Fatal (err )
9090 }
9191
92- if err := stmt .BindBlob (1 , [] byte ( "" ) ); err != nil {
92+ if err := stmt .BindRawText (1 , nil ); err != nil {
9393 t .Fatal (err )
9494 }
9595 if err := stmt .Exec (); err != nil {
9696 t .Fatal (err )
9797 }
9898
99- if err := stmt .BindBlob (1 , []byte ("blob " )); err != nil {
99+ if err := stmt .BindBlob (1 , []byte ("" )); err != nil {
100100 t .Fatal (err )
101101 }
102102 if err := stmt .Exec (); err != nil {
103103 t .Fatal (err )
104104 }
105105
106- if err := stmt .BindBlob (1 , nil ); err != nil {
106+ if err := stmt .BindBlob (1 , [] byte ( "blob" ) ); err != nil {
107107 t .Fatal (err )
108108 }
109109 if err := stmt .Exec (); err != nil {
@@ -354,8 +354,8 @@ func TestStmt(t *testing.T) {
354354 }
355355
356356 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 )
359359 }
360360 if got := stmt .ColumnBool (0 ); got != false {
361361 t .Errorf ("got %v, want false" , got )
@@ -391,11 +391,11 @@ func TestStmt(t *testing.T) {
391391 if got := stmt .ColumnFloat (0 ); got != 0 {
392392 t .Errorf ("got %v, want zero" , got )
393393 }
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 )
396396 }
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 )
399399 }
400400 var got any
401401 if err := stmt .ColumnJSON (0 , & got ); err == nil {
@@ -404,8 +404,8 @@ func TestStmt(t *testing.T) {
404404 }
405405
406406 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 )
409409 }
410410 if got := stmt .ColumnBool (0 ); got != false {
411411 t .Errorf ("got %v, want false" , got )
@@ -416,17 +416,15 @@ func TestStmt(t *testing.T) {
416416 if got := stmt .ColumnFloat (0 ); got != 0 {
417417 t .Errorf ("got %v, want zero" , got )
418418 }
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 )
421421 }
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 )
424424 }
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 )
430428 }
431429 }
432430
0 commit comments