pkt: parse want and have lines

This commit is contained in:
Carlos Martín Nieto
2013-05-27 10:56:19 +02:00
parent 23baf9a8b0
commit 03f43d3265
2 changed files with 43 additions and 1 deletions

12
test/pkt_test.erl Normal file
View File

@@ -0,0 +1,12 @@
-module(pkt_test).
-compile([export_all]).
-include_lib("eunit/include/eunit.hrl").
-include("src/geef_records.hrl").
flush_test() ->
geef_pkt:parse("0000").
have_test() ->
Expected = {{want, geef_oid:parse("e17ca7f2d877acbf8b9a9a1cb4c243ca72e86463")}, <<>>},
Actual = geef_pkt:parse("0032want e17ca7f2d877acbf8b9a9a1cb4c243ca72e86463\n"),
?assertEqual(Expected, Actual).