test: add store_bad_packet binary+map inputs

This commit is contained in:
Graham McIntire 2026-04-23 17:42:39 -05:00
parent 0f4e5234f1
commit fb1131159b
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -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