2025-06-11 16:01:49 +02:00
|
|
|
package fmp
|
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
|
|
|
func TestOpenFile(t *testing.T) {
|
|
|
|
f, err := OpenFile("../files/Untitled.fmp12")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2025-06-11 16:19:31 +02:00
|
|
|
if f.FileSize != 393216 {
|
|
|
|
t.Errorf("expected file size to be 393216, got %d", f.FileSize)
|
|
|
|
}
|
|
|
|
if f.NumSectors != 96 {
|
|
|
|
t.Errorf("expected number of sectors to be 96, got %d", f.NumSectors)
|
|
|
|
}
|
2025-06-11 16:01:49 +02:00
|
|
|
if f.ApplicationName != "Pro 12.0" {
|
|
|
|
t.Errorf("expected application name to be 'Pro 12.0', got '%s'", f.ApplicationName)
|
|
|
|
}
|
|
|
|
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"))
|
|
|
|
}
|
|
|
|
}
|