move types out of decoders package

This commit is contained in:
2025-10-17 15:27:33 -05:00
parent 7dd6d45a08
commit 7b1dc4bfd6
54 changed files with 558 additions and 490 deletions
+6 -6
View File
@@ -5,14 +5,14 @@ import (
"reflect"
"testing"
"github.com/jwetzell/psn-go/internal/decoders"
"github.com/jwetzell/psn-go/internal/chunks"
)
func TestChunkEncoding(t *testing.T) {
testCases := []struct {
description string
expected []byte
chunk decoders.Chunk
chunk chunks.Chunk
}{
{
description: "info packet",
@@ -21,8 +21,8 @@ func TestChunkEncoding(t *testing.T) {
0x01, 0x01, 0x00, 0x0b, 0x00, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x4e, 0x61, 0x6d, 0x65, 0x02, 0x00, 0x11,
0x80, 0x01, 0x00, 0x0d, 0x80, 0x00, 0x00, 0x09, 0x00, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x20, 0x31,
},
chunk: decoders.Chunk{
Header: decoders.ChunkHeader{
chunk: chunks.Chunk{
Header: chunks.ChunkHeader{
Id: uint16(26454),
DataLen: uint16(52),
HasSubchunks: true,
@@ -41,8 +41,8 @@ func TestChunkEncoding(t *testing.T) {
0x01, 0x01, 0x00, 0x14, 0x80, 0x01, 0x00, 0x10, 0x80, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00,
0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f,
},
chunk: decoders.Chunk{
Header: decoders.ChunkHeader{
chunk: chunks.Chunk{
Header: chunks.ChunkHeader{
Id: uint16(26453),
DataLen: uint16(40),
HasSubchunks: true,