diff options
author | Guido Günther <agx@sigxcpu.org> | 2015-12-13 17:47:14 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2015-12-13 17:47:14 +0100 |
commit | bd3ae9694c0e8669c8ce53aef685e8afede14f33 (patch) | |
tree | e849857832827f7be9a3166932bae7fe749fc84a /test/coap_parse_test.erl |
Diffstat (limited to 'test/coap_parse_test.erl')
-rw-r--r-- | test/coap_parse_test.erl | 19 |
1 files changed, 19 insertions, 0 deletions
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">>])]. + |