mirror of
https://github.com/garraflavatra/go-fmp.git
synced 2025-06-28 04:25:11 +00:00
Parse table columns
This commit is contained in:
@ -38,4 +38,30 @@ func TestTables(t *testing.T) {
|
||||
if !slicesHaveSameElements(tableNames, expectedNames) {
|
||||
t.Errorf("tables do not match")
|
||||
}
|
||||
|
||||
var field FmpColumn
|
||||
for _, table := range tables {
|
||||
for _, column := range table.Columns {
|
||||
if column.Name == "PrimaryKey" {
|
||||
field = column
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if field.Type != FmpFieldSimple {
|
||||
t.Errorf("expected field type to be simple, but it is not")
|
||||
}
|
||||
if field.DataType != FmpDataText {
|
||||
t.Errorf("expected field data type to be text, but it is not")
|
||||
}
|
||||
if field.StorageType != FmpFieldStorageRegular {
|
||||
t.Errorf("expected field storage type to be regular, but it is not")
|
||||
}
|
||||
if !field.Indexed {
|
||||
t.Errorf("expected field to be indexed, but it is not")
|
||||
}
|
||||
if field.AutoEnter != FmpAutoEnterCalculationReplacingExistingValue {
|
||||
t.Errorf("expected field to have auto enter calculation replacing existing value, but it does not")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user