Skip to content

Commit

Permalink
Remove accidental superfluous braces; add test
Browse files Browse the repository at this point in the history
The change in 36d6d91 turned out to not
fix the issue due to the extra braces. This fixes it and adds a test to
be sure.
  • Loading branch information
fhunleth committed Feb 27, 2024
1 parent a6a652c commit e340988
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mdns_lite/responder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ defmodule MdnsLite.Responder do
def stop_server(ifname, address) do
GenServer.stop(via_name({ifname, address}))
catch
{:exit, {:noproc, _}} ->
:exit, {:noproc, _} ->
# Ignore if the server already stopped. It already exited due to the
# network going down.
:ok
Expand Down
6 changes: 6 additions & 0 deletions test/mdns_lite/responder_test.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
defmodule MdnsLite.ResponderTest do
use ExUnit.Case, async: false

alias MdnsLite.Responder

test "stopping a nonexistent responder" do
Responder.stop_server("no_exist", {1, 2, 3, 4})
end
end

0 comments on commit e340988

Please sign in to comment.