aboutsummaryrefslogtreecommitdiff
path: root/hotline/flattened_file_object_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'hotline/flattened_file_object_test.go')
-rw-r--r--hotline/flattened_file_object_test.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/hotline/flattened_file_object_test.go b/hotline/flattened_file_object_test.go
index 5bbaf1d..12b6d32 100644
--- a/hotline/flattened_file_object_test.go
+++ b/hotline/flattened_file_object_test.go
@@ -43,7 +43,7 @@ func TestNewFlattenedFileObject(t *testing.T) {
want: &flattenedFileObject{
FlatFileHeader: NewFlatFileHeader(),
FlatFileInformationForkHeader: FlatFileInformationForkHeader{},
- FlatFileInformationFork: NewFlatFileInformationFork("testfile.txt"),
+ FlatFileInformationFork: NewFlatFileInformationFork("testfile.txt", make([]byte, 8)),
FlatFileDataForkHeader: FlatFileDataForkHeader{
ForkType: []byte("DATA"),
CompressionType: []byte{0, 0, 0, 0},
@@ -67,9 +67,14 @@ func TestNewFlattenedFileObject(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := NewFlattenedFileObject(tt.args.fileRoot, tt.args.filePath, tt.args.fileName)
- if !tt.wantErr(t, err, fmt.Sprintf("NewFlattenedFileObject(%v, %v, %v)", tt.args.fileRoot, tt.args.filePath, tt.args.fileName)) {
+ if tt.wantErr(t, err, fmt.Sprintf("NewFlattenedFileObject(%v, %v, %v)", tt.args.fileRoot, tt.args.filePath, tt.args.fileName)) {
return
}
+
+ // Clear the file timestamp fields to work around problems running the tests in multiple timezones
+ // TODO: revisit how to test this by mocking the stat calls
+ got.FlatFileInformationFork.CreateDate = make([]byte, 8)
+ got.FlatFileInformationFork.ModifyDate = make([]byte, 8)
assert.Equalf(t, tt.want, got, "NewFlattenedFileObject(%v, %v, %v)", tt.args.fileRoot, tt.args.filePath, tt.args.fileName)
})
}