aboutsummaryrefslogtreecommitdiffstats
path: root/test/h2specd_SUITE.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-12-19 14:35:48 +0100
committerLoïc Hoguin <[email protected]>2018-12-19 14:35:48 +0100
commitd1cda6d1f05b672bc29bea5e84de6b0bb6815863 (patch)
tree6a5526e8bafe9393f0928f92e1217bf2449db735 /test/h2specd_SUITE.erl
parentd6e72889886b61eb51be5982dff621493d7cb530 (diff)
downloadgun-d1cda6d1f05b672bc29bea5e84de6b0bb6815863.tar.gz
gun-d1cda6d1f05b672bc29bea5e84de6b0bb6815863.tar.bz2
gun-d1cda6d1f05b672bc29bea5e84de6b0bb6815863.zip
Get rid of duplicates in h2specd output
I'm not sure what caused the duplicates to appear, but they should be gone now.
Diffstat (limited to 'test/h2specd_SUITE.erl')
-rw-r--r--test/h2specd_SUITE.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/h2specd_SUITE.erl b/test/h2specd_SUITE.erl
index de17341..7153a7b 100644
--- a/test/h2specd_SUITE.erl
+++ b/test/h2specd_SUITE.erl
@@ -68,7 +68,12 @@ receive_infinity(Port, Acc) ->
receive
{Port, {data, {eol, Line}}} ->
ct:log("~ts", [Line]),
- io:format(user, "~s~n", [Line]),
+ %% Somehow we may receive the same line multiple times.
+ %% We therefore only print if it's a line we didn't print before.
+ case lists:member(Line, Acc) of
+ false -> io:format(user, "~s~n", [Line]);
+ true -> ok
+ end,
receive_infinity(Port, [Line|Acc]);
{Port, Reason={exit_status, _}} ->
ct:log("~ts", [[[L, $\n] || L <- lists:reverse(Acc)]]),