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