Skip to content

Commit

Permalink
💄
Browse files Browse the repository at this point in the history
  • Loading branch information
yurrriq committed Dec 27, 2016
1 parent f70d38b commit 1c78700
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
10 changes: 7 additions & 3 deletions test/.dir-locals.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
((nil . ((fill-column . 90)))
(erlang-mode . ((flycheck-erlang-library-path . ("../_build/default/lib/elli_cache"
"../_build/default/lib/elli_cache/ebin")))))
((nil
. ((fill-column . 80)
(eval . (turn-on-fci-mode))))
(erlang-mode
. ((flycheck-erlang-library-path
. ("../_build/default/lib/elli_cache"
"../_build/default/lib/elli_cache/ebin")))))
20 changes: 13 additions & 7 deletions test/rfc7232_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@

-include_lib("eunit/include/eunit.hrl").

%%% ============================================================= [ Unit Tests ]

comparison_test_() ->
[
compare(<<"W/\"1\"">>, <<"W/\"1\"">>, no_match, match),
compare(<<"W/\"1\"">>, <<"W/\"2\"">>, no_match, no_match),
compare(<<"W/\"1\"">>, <<"\"1\"">>, no_match, match),
compare(<<"\"1\"">>, <<"\"1\"">>, match, match)
].

%%% ===================================================== [ Internal Functions ]

compare(ETag1, ETag2, Strong, Weak) ->
Comparisons = [
{<<"Strong">>, fun rfc7232:compare_strong/2, Strong},
Expand All @@ -28,10 +40,4 @@ assertion(Compare, ETag1, ETag2, match) ->
assertion(Compare, ETag1, ETag2, no_match) ->
?_assertNot(Compare(ETag1, ETag2)).

comparison_test_() ->
[
compare(<<"W/\"1\"">>, <<"W/\"1\"">>, no_match, match),
compare(<<"W/\"1\"">>, <<"W/\"2\"">>, no_match, no_match),
compare(<<"W/\"1\"">>, <<"\"1\"">>, no_match, match),
compare(<<"\"1\"">>, <<"\"1\"">>, match, match)
].
%%% ==================================================================== [ EOF ]

0 comments on commit 1c78700

Please sign in to comment.