diff options
author | Loïc Hoguin <[email protected]> | 2018-12-19 14:35:48 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-12-19 14:35:48 +0100 |
commit | d1cda6d1f05b672bc29bea5e84de6b0bb6815863 (patch) | |
tree | 6a5526e8bafe9393f0928f92e1217bf2449db735 | |
parent | d6e72889886b61eb51be5982dff621493d7cb530 (diff) | |
download | gun-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.
-rw-r--r-- | test/h2specd_SUITE.erl | 7 |
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)]]), |