aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-12-16 10:33:13 +0200
committerLoïc Hoguin <[email protected]>2014-12-16 10:33:13 +0200
commit037225bbcf727479c88d1a18127fe169b66b7e12 (patch)
tree3f2209ea2fb3c4ed29eb5813cafd969750f4229c /src
parente009aa2e31893e52c033049b7ae8ca5059474f3b (diff)
downloadcowlib-037225bbcf727479c88d1a18127fe169b66b7e12.tar.gz
cowlib-037225bbcf727479c88d1a18127fe169b66b7e12.tar.bz2
cowlib-037225bbcf727479c88d1a18127fe169b66b7e12.zip
Add property for cow_http_hd:parse_expect/1
Diffstat (limited to 'src')
-rw-r--r--src/cow_http_hd.erl11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cow_http_hd.erl b/src/cow_http_hd.erl
index 6e70185..a597811 100644
--- a/src/cow_http_hd.erl
+++ b/src/cow_http_hd.erl
@@ -956,6 +956,17 @@ parse_expect(<<"100-", C, O, N, T, I, M, U, E, Rest/bits >>)
continue.
-ifdef(TEST).
+expect() ->
+ ?LET(E,
+ [$1, $0, $0, $-,
+ oneof([$c, $C]), oneof([$o, $O]), oneof([$n, $N]),
+ oneof([$t, $T]), oneof([$i, $I]), oneof([$n, $N]),
+ oneof([$u, $U]), oneof([$e, $E])],
+ list_to_binary(E)).
+
+prop_parse_expect() ->
+ ?FORALL(E, expect(), continue =:= parse_expect(E)).
+
parse_expect_test_() ->
Tests = [
<<"100-continue">>,