From fb1131159bb9a3e7f84b9cc5eeda20f5f26baa0a Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Thu, 23 Apr 2026 17:42:39 -0500 Subject: [PATCH] test: add store_bad_packet binary+map inputs --- test/aprsme/packets_test.exs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/aprsme/packets_test.exs b/test/aprsme/packets_test.exs index 15ba9b3..f8c454b 100644 --- a/test/aprsme/packets_test.exs +++ b/test/aprsme/packets_test.exs @@ -1097,4 +1097,19 @@ defmodule Aprsme.PacketsTest do assert result == [] or result == %{} end end + + describe "store_bad_packet/2 map and binary inputs" do + test "stores a bad packet from a binary raw packet" do + assert {:ok, _} = + Packets.store_bad_packet("BAD-RAW>APRS:corrupt", %{message: "parse error", type: "ParseError"}) + end + + test "stores a bad packet from a map payload" do + assert {:ok, _} = + Packets.store_bad_packet( + %{sender: "BAD-MAP", raw: "BAD-MAP>APRS:junk"}, + %{message: "schema error", type: "ValidationError"} + ) + end + end end