Skip to content

Commit

Permalink
test: remove unneeded match?/2 calls and instead use = operator (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hauleth authored Nov 13, 2024
1 parent 62b642a commit 9982a32
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions test/integration/proxy_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule Supavisor.Integration.ProxyTest do
use Supavisor.DataCase, async: true
use Supavisor.DataCase, async: false

require Logger

Expand Down Expand Up @@ -361,20 +361,17 @@ defmodule Supavisor.Integration.ProxyTest do
id = {{:single, @tenant}, db_conf[:username], :session, db_conf[:database], nil}
[{client_pid, _}] = Registry.lookup(Supavisor.Registry.TenantClients, id)

assert match?({_, %{active_count: 1}}, :sys.get_state(client_pid))
assert {_, %{active_count: 1}} = :sys.get_state(client_pid)

Enum.each(0..200, fn _ ->
P.SimpleConnection.call(pid, {:query, "select 1;"})
end)

assert match?(
[
%Postgrex.Result{
command: :select
}
],
P.SimpleConnection.call(pid, {:query, "select 1;"})
)
assert [
%Postgrex.Result{
command: :select
}
] = P.SimpleConnection.call(pid, {:query, "select 1;"})
end

defp single_connection(db_conf, c_port \\ nil) when is_list(db_conf) do
Expand Down

0 comments on commit 9982a32

Please sign in to comment.