1
0
mirror of https://github.com/garraflavatra/go-fmp.git synced 2025-06-28 04:25:11 +00:00

Table parsing (WIP)

This commit is contained in:
2025-06-12 11:44:57 +02:00
parent 43523c458a
commit 8562e1147b
6 changed files with 68 additions and 17 deletions

View File

@ -19,6 +19,24 @@ func TestOpenFile(t *testing.T) {
if f.VersionDate.Format("2006-01-02") != "2025-01-11" {
t.Errorf("expected version date to be '2025-01-11', got '%s'", f.VersionDate.Format("2006-01-02"))
}
f.ToDebugFile("../private/output")
}
func TestTables(t *testing.T) {
f, err := OpenFile("../files/Untitled.fmp12")
if err != nil {
t.Fatal(err)
}
tables := f.Tables()
if len(tables) != 1 || tables[0].Name != "Untitled" {
tablesString := ""
for i, table := range tables {
tablesString += table.Name
if i < len(tables)-1 {
tablesString += ", "
}
}
t.Errorf("expected tables to be 'Untitled', got '%s'", tablesString)
}
}