mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 05:15:47 +00:00
clean up json.encode test
This commit is contained in:
@@ -9,15 +9,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestGoodJsonEncode(t *testing.T) {
|
func TestGoodJsonEncode(t *testing.T) {
|
||||||
stringEncoder := processor.JsonEncode{}
|
jsonEncoder := processor.JsonEncode{}
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
processor processor.Processor
|
|
||||||
name string
|
name string
|
||||||
payload any
|
payload any
|
||||||
expected []byte
|
expected []byte
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
processor: &stringEncoder,
|
|
||||||
name: "hello",
|
name: "hello",
|
||||||
payload: osc.OSCMessage{
|
payload: osc.OSCMessage{
|
||||||
Address: "/hello",
|
Address: "/hello",
|
||||||
@@ -28,7 +26,7 @@ func TestGoodJsonEncode(t *testing.T) {
|
|||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
t.Run(test.name, func(t *testing.T) {
|
t.Run(test.name, func(t *testing.T) {
|
||||||
got, err := test.processor.Process(t.Context(), test.payload)
|
got, err := jsonEncoder.Process(t.Context(), test.payload)
|
||||||
|
|
||||||
gotBytes, ok := got.([]byte)
|
gotBytes, ok := got.([]byte)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|||||||
Reference in New Issue
Block a user