aboutsummaryrefslogtreecommitdiff
path: root/test/coap_parse_test.erl
blob: 59b8510a411fefdbc96d88a5dfbbebee78c66f01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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">>])].