Files
sqlite3/tests/type_test.go

31 lines
521 B
Go
Raw Permalink Normal View History

2023-03-07 14:19:22 +00:00
package tests
2023-02-08 00:00:53 +00:00
2023-03-07 14:19:22 +00:00
import (
"testing"
"github.com/ncruces/go-sqlite3"
)
2023-02-08 00:00:53 +00:00
func TestDatatype_String(t *testing.T) {
2023-02-22 14:19:56 +00:00
t.Parallel()
2023-02-08 00:00:53 +00:00
tests := []struct {
2023-03-07 14:19:22 +00:00
data sqlite3.Datatype
2023-02-08 00:00:53 +00:00
want string
}{
2023-03-07 14:19:22 +00:00
{sqlite3.INTEGER, "INTEGER"},
{sqlite3.FLOAT, "FLOAT"},
{sqlite3.TEXT, "TEXT"},
{sqlite3.BLOB, "BLOB"},
{sqlite3.NULL, "NULL"},
2023-02-08 00:00:53 +00:00
{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)
}
})
}
}