add tests

This commit is contained in:
mmacia committed 2026-04-24 21:09:51 +00:00
1 parent a763ceb6df
commit c77bd48f95
3 files changed
+190

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
defmodule FeedReader.TestSupport.ParserHaltFormat do
@behaviour FeedReader.Format
@impl true
def id, do: :parser_halt
@impl true
def matches_prefix?(_prefix), do: true
@impl true
def handler, do: FeedReader.TestSupport.ParserHaltHandler
@impl true
def new_parser_state(_event_sink, opts) do
if Keyword.get(opts, :normal_exit), do: exit(:normal)
nil
end
@impl true
def normalize_feed(_state, _opts), do: %FeedReader.Feed{}
@impl true
def normalize_item(_raw_item, _feed, _opts), do: :skip
end
+6
View File
@@ -0,0 +1,6 @@
defmodule FeedReader.TestSupport.ParserHaltHandler do
@behaviour Saxy.Handler
@impl true
def handle_event(_event, _data, _state), do: {:halt, :stopped}
end