]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/file_name_with_info_test.go
Extensive refactor, quality of life enhancements
[rbdr/mobius] / hotline / file_name_with_info_test.go
index 0473631ab12e1996000a449312b837b8db26e2b0..d1b03c20f842884a812a394b9da595d64538cb16 100644 (file)
@@ -9,7 +9,7 @@ import (
 
 func TestFileNameWithInfo_MarshalBinary(t *testing.T) {
        type fields struct {
-               fileNameWithInfoHeader fileNameWithInfoHeader
+               fileNameWithInfoHeader FileNameWithInfoHeader
                name                   []byte
        }
        tests := []struct {
@@ -21,7 +21,7 @@ func TestFileNameWithInfo_MarshalBinary(t *testing.T) {
                {
                        name: "returns expected bytes",
                        fields: fields{
-                               fileNameWithInfoHeader: fileNameWithInfoHeader{
+                               fileNameWithInfoHeader: FileNameWithInfoHeader{
                                        Type:       [4]byte{0x54, 0x45, 0x58, 0x54}, // TEXT
                                        Creator:    [4]byte{0x54, 0x54, 0x58, 0x54}, // TTXT
                                        FileSize:   [4]byte{0x00, 0x43, 0x16, 0xd3}, // File Size
@@ -46,8 +46,8 @@ func TestFileNameWithInfo_MarshalBinary(t *testing.T) {
        for _, tt := range tests {
                t.Run(tt.name, func(t *testing.T) {
                        f := &FileNameWithInfo{
-                               fileNameWithInfoHeader: tt.fields.fileNameWithInfoHeader,
-                               name:                   tt.fields.name,
+                               FileNameWithInfoHeader: tt.fields.fileNameWithInfoHeader,
+                               Name:                   tt.fields.name,
                        }
                        gotData, err := io.ReadAll(f)
                        if (err != nil) != tt.wantErr {
@@ -63,7 +63,7 @@ func TestFileNameWithInfo_MarshalBinary(t *testing.T) {
 
 func TestFileNameWithInfo_UnmarshalBinary(t *testing.T) {
        type fields struct {
-               fileNameWithInfoHeader fileNameWithInfoHeader
+               fileNameWithInfoHeader FileNameWithInfoHeader
                name                   []byte
        }
        type args struct {
@@ -90,7 +90,7 @@ func TestFileNameWithInfo_UnmarshalBinary(t *testing.T) {
                                },
                        },
                        want: &FileNameWithInfo{
-                               fileNameWithInfoHeader: fileNameWithInfoHeader{
+                               FileNameWithInfoHeader: FileNameWithInfoHeader{
                                        Type:       [4]byte{0x54, 0x45, 0x58, 0x54}, // TEXT
                                        Creator:    [4]byte{0x54, 0x54, 0x58, 0x54}, // TTXT
                                        FileSize:   [4]byte{0x00, 0x43, 0x16, 0xd3}, // File Size
@@ -98,7 +98,7 @@ func TestFileNameWithInfo_UnmarshalBinary(t *testing.T) {
                                        NameScript: [2]byte{0, 0},
                                        NameSize:   [2]byte{0x00, 0x0e},
                                },
-                               name: []byte("Audion.app.zip"),
+                               Name: []byte("Audion.app.zip"),
                        },
                        wantErr: false,
                },
@@ -106,8 +106,8 @@ func TestFileNameWithInfo_UnmarshalBinary(t *testing.T) {
        for _, tt := range tests {
                t.Run(tt.name, func(t *testing.T) {
                        f := &FileNameWithInfo{
-                               fileNameWithInfoHeader: tt.fields.fileNameWithInfoHeader,
-                               name:                   tt.fields.name,
+                               FileNameWithInfoHeader: tt.fields.fileNameWithInfoHeader,
+                               Name:                   tt.fields.name,
                        }
                        if _, err := f.Write(tt.args.data); (err != nil) != tt.wantErr {
                                t.Errorf("Write() error = %v, wantErr %v", err, tt.wantErr)