This commit is contained in:
Nuno Cruces
2023-03-07 14:19:22 +00:00
parent dfcdbf9c4c
commit f5747f19fb
9 changed files with 173 additions and 132 deletions

30
tests/type_test.go Normal file
View File

@@ -0,0 +1,30 @@
package tests
import (
"testing"
"github.com/ncruces/go-sqlite3"
)
func TestDatatype_String(t *testing.T) {
t.Parallel()
tests := []struct {
data sqlite3.Datatype
want string
}{
{sqlite3.INTEGER, "INTEGER"},
{sqlite3.FLOAT, "FLOAT"},
{sqlite3.TEXT, "TEXT"},
{sqlite3.BLOB, "BLOB"},
{sqlite3.NULL, "NULL"},
{10, "10"},
}
for _, tt := range tests {
t.Run(tt.want, func(t *testing.T) {
if got := tt.data.String(); got != tt.want {
t.Errorf("got %v, want %v", got, tt.want)
}
})
}
}