Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach committed Aug 27, 2023
1 parent 744b3f4 commit d2a671a
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions test/req/httpc_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,17 @@ defmodule Req.HttpcTest do

{req, resp} = Req.async_request!(req)
assert resp.status == 200
assert {:ok, [data: "foobar"]} = Req.parse_message(req, assert_receive(_))

case Req.parse_message(req, assert_receive(_)) do
{:ok, [:done]} ->
:ok
assert Req.parse_message(req, assert_receive(_)) in [
{:ok, [data: "foo"]},
{:ok, [data: "foobar"]}
]

# TODO: investigate
{:ok, [data: ""]} ->
assert {:ok, [:done]} = Req.parse_message(req, assert_receive(_))
end

refute_receive _
assert Req.parse_message(req, assert_receive(_)) in [
{:ok, [data: "bar"]},
{:ok, [data: ""]},
{:ok, [:done]}
]
end

test "async request cancellation", %{req: req, bypass: bypass} do
Expand Down

0 comments on commit d2a671a

Please sign in to comment.