From bd3ae9694c0e8669c8ce53aef685e8afede14f33 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sun, 13 Dec 2015 17:47:14 +0100 Subject: Initial commit --- test/coap_parse_test.erl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/coap_parse_test.erl (limited to 'test/coap_parse_test.erl') diff --git a/test/coap_parse_test.erl b/test/coap_parse_test.erl new file mode 100644 index 0000000..59b8510 --- /dev/null +++ b/test/coap_parse_test.erl @@ -0,0 +1,19 @@ +-module(coap_parse_test). +-include_lib("eunit/include/eunit.hrl"). + +-include("coaperl.hrl"). + +% Test descriptions +parse_test_() -> + [{"Option extration works", + check_get_option_values()} + ]. + +% Tests +check_get_option_values() -> + Ret = coap_parse:get_option_values(#coap_response{options=[{coap_option,11,<<"bar">>}, + {coap_option,11,<<"baz">>}, + {coap_option,12,<<"foo">>}]}, + 11), + [?_assertEqual(Ret, [<<"bar">>, <<"baz">>])]. + -- cgit v1.2.3