added test to sql/types
This commit is contained in:
parent
882959ba83
commit
661b7ff0c1
@ -28,3 +28,17 @@ func TestParseColumnList(t *testing.T) {
|
|||||||
test.S(t).ExpectEquals(columnList.Ordinals["category"], 1)
|
test.S(t).ExpectEquals(columnList.Ordinals["category"], 1)
|
||||||
test.S(t).ExpectEquals(columnList.Ordinals["max_len"], 2)
|
test.S(t).ExpectEquals(columnList.Ordinals["max_len"], 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGetColumn(t *testing.T) {
|
||||||
|
names := "id,category,max_len"
|
||||||
|
columnList := ParseColumnList(names)
|
||||||
|
{
|
||||||
|
column := columnList.GetColumn("category")
|
||||||
|
test.S(t).ExpectTrue(column != nil)
|
||||||
|
test.S(t).ExpectEquals(column.Name, "category")
|
||||||
|
}
|
||||||
|
{
|
||||||
|
column := columnList.GetColumn("no_such_column")
|
||||||
|
test.S(t).ExpectTrue(column == nil)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user