From 037225bbcf727479c88d1a18127fe169b66b7e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 16 Dec 2014 10:33:13 +0200 Subject: Add property for cow_http_hd:parse_expect/1 --- src/cow_http_hd.erl | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') 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">>, -- cgit v1.2.3