Skip to content

Commit 140b805

Browse files
author
Lucas Manuel Rodriguez
committed
Add zero-length slice test
1 parent 8d6d326 commit 140b805

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sqlite3_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,6 +1593,10 @@ func TestInsertNilByteSlice(t *testing.T) {
15931593
if _, err := db.Exec("insert into blob_not_null (b) values (?)", nilSlice); err == nil {
15941594
t.Fatal("didn't expect INSERT to 'not null' column with a nil []byte slice to work")
15951595
}
1596+
zeroLenSlice := []byte{}
1597+
if _, err := db.Exec("insert into blob_not_null (b) values (?)", zeroLenSlice); err != nil {
1598+
t.Fatal("failed to insert zero-length slice")
1599+
}
15961600
}
15971601

15981602
var customFunctionOnce sync.Once

0 commit comments

Comments
 (0)