mirror of
https://github.com/garraflavatra/go-fmp.git
synced 2025-06-28 04:25:11 +00:00
Parse field repetition count
This commit is contained in:
@ -13,6 +13,7 @@ type FmpColumn struct {
|
|||||||
DataType FmpDataType
|
DataType FmpDataType
|
||||||
StorageType FmpFieldStorageType
|
StorageType FmpFieldStorageType
|
||||||
AutoEnter FmpAutoEnterOption
|
AutoEnter FmpAutoEnterOption
|
||||||
|
Repetitions uint8
|
||||||
Indexed bool
|
Indexed bool
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,6 +45,7 @@ func (ctx *FmpFile) Tables() []*FmpTable {
|
|||||||
Type: FmpFieldType(flags[0]),
|
Type: FmpFieldType(flags[0]),
|
||||||
DataType: FmpDataType(flags[1]),
|
DataType: FmpDataType(flags[1]),
|
||||||
StorageType: FmpFieldStorageType(flags[9]),
|
StorageType: FmpFieldStorageType(flags[9]),
|
||||||
|
Repetitions: flags[25],
|
||||||
Indexed: flags[8] == 128,
|
Indexed: flags[8] == 128,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +58,9 @@ func TestTables(t *testing.T) {
|
|||||||
if field.StorageType != FmpFieldStorageRegular {
|
if field.StorageType != FmpFieldStorageRegular {
|
||||||
t.Errorf("expected field storage type to be regular, but it is not")
|
t.Errorf("expected field storage type to be regular, but it is not")
|
||||||
}
|
}
|
||||||
|
if field.Repetitions != 1 {
|
||||||
|
t.Errorf("expected field repetition count to be 1, but it is %d", field.Repetitions)
|
||||||
|
}
|
||||||
if !field.Indexed {
|
if !field.Indexed {
|
||||||
t.Errorf("expected field to be indexed, but it is not")
|
t.Errorf("expected field to be indexed, but it is not")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user