aboutsummaryrefslogtreecommitdiff
path: root/hotline/news_test.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2024-06-09 13:56:29 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2024-06-09 14:05:15 -0700
commit9cf66aeafbcbb9237fedc2efc97cc2856eb60f7f (patch)
treec3139d8af2bd6ae106a1f619cad7d64f2ddea6db /hotline/news_test.go
parentb129b7cbc9fd9a9c11a77e5922861ef08893efa1 (diff)
Convert more bespoke methods to io.Reader/io.Writer interfaces
Diffstat (limited to 'hotline/news_test.go')
-rw-r--r--hotline/news_test.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/hotline/news_test.go b/hotline/news_test.go
index 02e11a9..44776dd 100644
--- a/hotline/news_test.go
+++ b/hotline/news_test.go
@@ -1,14 +1,13 @@
package hotline
import (
- "bytes"
"reflect"
"testing"
)
func TestNewsCategoryListData15_MarshalBinary(t *testing.T) {
type fields struct {
- Type []byte
+ Type [2]byte
Name string
Articles map[uint32]*NewsArtData
SubCats map[string]NewsCategoryListData15
@@ -26,7 +25,7 @@ func TestNewsCategoryListData15_MarshalBinary(t *testing.T) {
{
name: "returns expected bytes when type is a bundle",
fields: fields{
- Type: []byte{0x00, 0x02},
+ Type: [2]byte{0x00, 0x02},
Articles: map[uint32]*NewsArtData{
uint32(1): {
Title: "",
@@ -47,7 +46,7 @@ func TestNewsCategoryListData15_MarshalBinary(t *testing.T) {
{
name: "returns expected bytes when type is a category",
fields: fields{
- Type: []byte{0x00, 0x03},
+ Type: [2]byte{0x00, 0x03},
Articles: map[uint32]*NewsArtData{
uint32(1): {
Title: "",
@@ -82,7 +81,7 @@ func TestNewsCategoryListData15_MarshalBinary(t *testing.T) {
GUID: tt.fields.GUID,
}
gotData, err := newscat.MarshalBinary()
- if bytes.Equal(newscat.Type, []byte{0, 3}) {
+ if newscat.Type == [2]byte{0, 3} {
// zero out the random GUID before comparison
for i := 4; i < 20; i++ {
gotData[i] = 0