From 460d2f051d122c252ef0355e542400491a60fff3 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Wed, 24 Dec 2025 18:17:57 -0600 Subject: [PATCH] switch separator test to use GetFramer --- internal/framer/separator_test.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/internal/framer/separator_test.go b/internal/framer/separator_test.go index a5e1ddf..62adfc1 100644 --- a/internal/framer/separator_test.go +++ b/internal/framer/separator_test.go @@ -17,7 +17,7 @@ func TestGoodSeparatorFramer(t *testing.T) { }{ { name: "new line separator", - framer: framer.NewByteSeparatorFramer([]byte{0x0a}), + framer: framer.GetFramer("LF"), input: []byte("Hello\nWorld\nThis is a test\n"), expected: [][]byte{ []byte("Hello"), @@ -26,9 +26,20 @@ func TestGoodSeparatorFramer(t *testing.T) { }, buffer: []byte{}, }, + { + name: "CR separator", + framer: framer.GetFramer("CR"), + input: []byte("Hello\rWorld\rThis is a test\r"), + expected: [][]byte{ + []byte("Hello"), + []byte("World"), + []byte("This is a test"), + }, + buffer: []byte{}, + }, { name: "CRLF separator", - framer: framer.NewByteSeparatorFramer([]byte{0x0d, 0x0a}), + framer: framer.GetFramer("CRLF"), input: []byte("Hello\r\nWorld\r\nThis is a test\r\n"), expected: [][]byte{ []byte("Hello"), @@ -39,7 +50,7 @@ func TestGoodSeparatorFramer(t *testing.T) { }, { name: "extra data after separator", - framer: framer.NewByteSeparatorFramer([]byte{0x0d, 0x0a}), + framer: framer.GetFramer("CRLF"), input: []byte("Hello\r\nWorld\r\nThis is a test\r\nextra"), expected: [][]byte{ []byte("Hello"),