]> git.r.bdr.sh - rbdr/mobius/blame - hotline/flattened_file_object_test.go
Fix line break for emote messages
[rbdr/mobius] / hotline / flattened_file_object_test.go
CommitLineData
6988a057
JH
1package hotline
2
3import (
4 "bytes"
5 "encoding/hex"
6 "testing"
7)
8
9func 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}
5c34f875 20
6988a057
JH
21//
22//func TestNewFlattenedFileObject(t *testing.T) {
23// ffo := NewFlattenedFileObject("test/config/files", "testfile.txt")
24//
25// dataSize := ffo.FlatFileDataForkHeader.DataSize
26// want := []byte{0, 0, 0, 0x17}
27// if bytes.Compare(dataSize, want) != 0 {
28// t.Errorf("%q, want %q", dataSize, want)
29// }
30//
31// comment := ffo.FlatFileInformationFork.Comment
32// want = []byte("Test Comment")
33// if bytes.Compare(ffo.FlatFileInformationFork.Comment, want) != 0 {
34// t.Errorf("%q, want %q", comment, want)
35// }
36//}