github.com/ncruces/go-sqlite3@v0.15.1-0.20240520133447-53eef1510ff0/tests/type_test.go (about)

     1  package tests
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/ncruces/go-sqlite3"
     7  )
     8  
     9  func TestDatatype_String(t *testing.T) {
    10  	t.Parallel()
    11  
    12  	tests := []struct {
    13  		data sqlite3.Datatype
    14  		want string
    15  	}{
    16  		{sqlite3.INTEGER, "INTEGER"},
    17  		{sqlite3.FLOAT, "FLOAT"},
    18  		{sqlite3.TEXT, "TEXT"},
    19  		{sqlite3.BLOB, "BLOB"},
    20  		{sqlite3.NULL, "NULL"},
    21  		{10, "10"},
    22  	}
    23  	for _, tt := range tests {
    24  		t.Run(tt.want, func(t *testing.T) {
    25  			if got := tt.data.String(); got != tt.want {
    26  				t.Errorf("got %v, want %v", got, tt.want)
    27  			}
    28  		})
    29  	}
    30  }