aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fake_transport.erl4
-rw-r--r--test/gun_http2_test.erl8
2 files changed, 12 insertions, 0 deletions
diff --git a/test/fake_transport.erl b/test/fake_transport.erl
new file mode 100644
index 0000000..80e9afd
--- /dev/null
+++ b/test/fake_transport.erl
@@ -0,0 +1,4 @@
+-module(fake_transport).
+-compile(export_all).
+
+send(Socket, Message) -> ok.
diff --git a/test/gun_http2_test.erl b/test/gun_http2_test.erl
new file mode 100644
index 0000000..1dd4d68
--- /dev/null
+++ b/test/gun_http2_test.erl
@@ -0,0 +1,8 @@
+-module(gun_http2_test).
+-include_lib("eunit/include/eunit.hrl").
+
+handle_go_away_test() ->
+ State = gun_http2:init(self(), socket, fake_transport, #{}),
+ Data = <<0,0,22,7,0,0,0,0,0,0,0,0,0,0,0,0,11,116,111,111,95,109,97,110,121,95,112,105,110,103,115>>,
+ Result = gun_http2:handle(Data, State),
+ ?assertEqual(close, Result).