]> git.r.bdr.sh - rbdr/mobius/blob - flattened_file_object_test.go
Initial squashed commit
[rbdr/mobius] / flattened_file_object_test.go
1 package hotline
2
3 import (
4 "bytes"
5 "encoding/hex"
6 "testing"
7 )
8
9 func TestReadFlattenedFileObject(t *testing.T) {
10 testData, _ := hex.DecodeString("46494c500001000000000000000000000000000000000002494e464f000000000000000000000052414d414354455854747478740000000000000100000000000000000000000000000000000000000000000000000000000000000007700000ba74247307700000ba74247300000008746573742e74787400004441544100000000000000000000000474657374")
11
12 ffo := ReadFlattenedFileObject(testData)
13
14 format := ffo.FlatFileHeader.Format
15 want := []byte("FILP")
16 if !bytes.Equal(format, want) {
17 t.Errorf("ReadFlattenedFileObject() = %q, want %q", format, want)
18 }
19 }
20 //
21 //func TestNewFlattenedFileObject(t *testing.T) {
22 // ffo := NewFlattenedFileObject("test/config/files", "testfile.txt")
23 //
24 // dataSize := ffo.FlatFileDataForkHeader.DataSize
25 // want := []byte{0, 0, 0, 0x17}
26 // if bytes.Compare(dataSize, want) != 0 {
27 // t.Errorf("%q, want %q", dataSize, want)
28 // }
29 //
30 // comment := ffo.FlatFileInformationFork.Comment
31 // want = []byte("Test Comment")
32 // if bytes.Compare(ffo.FlatFileInformationFork.Comment, want) != 0 {
33 // t.Errorf("%q, want %q", comment, want)
34 // }
35 //}