aboutsummaryrefslogtreecommitdiffstats
path: root/src/cow_http_hd.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/cow_http_hd.erl')
-rw-r--r--src/cow_http_hd.erl23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/cow_http_hd.erl b/src/cow_http_hd.erl
index 600f21a..08c392b 100644
--- a/src/cow_http_hd.erl
+++ b/src/cow_http_hd.erl
@@ -135,7 +135,7 @@
-include("cow_parse.hrl").
-ifdef(TEST).
--include_lib("triq/include/triq.hrl").
+-include_lib("proper/include/proper.hrl").
vector(Min, Max, Dom) -> ?LET(N, choose(Min, Max), vector(N, Dom)).
small_list(Dom) -> vector(0, 10, Dom).
@@ -162,13 +162,13 @@ token() ->
list_to_binary(T)).
abnf_char() ->
- int(1, 127).
+ integer(1, 127).
vchar() ->
- int(33, 126).
+ integer(33, 126).
obs_text() ->
- int(128, 255).
+ integer(128, 255).
qdtext() ->
frequency([
@@ -200,7 +200,7 @@ parameter() ->
weight() ->
frequency([
- {90, int(0, 1000)},
+ {90, integer(0, 1000)},
{10, undefined}
]).
@@ -1759,7 +1759,7 @@ etag(<< C, R/bits >>, Strength, Tag) when ?IS_ETAGC(C) ->
-ifdef(TEST).
etagc() ->
- ?SUCHTHAT(C, int(16#21, 16#ff), C =/= 16#22 andalso C =/= 16#7f).
+ ?SUCHTHAT(C, integer(16#21, 16#ff), C =/= 16#22 andalso C =/= 16#7f).
etag() ->
?LET({Strength, Tag},
@@ -1920,7 +1920,7 @@ host() -> vector(1, 255, elements(host_chars())).
host_port() ->
?LET({Host, Port},
- {host(), oneof([undefined, int(1, 65535)])},
+ {host(), oneof([undefined, integer(1, 65535)])},
begin
HostBin = list_to_binary(Host),
{{?LOWER(HostBin), Port},
@@ -2242,7 +2242,7 @@ scheme() -> oneof([<<"http">>, <<"https">>]).
scheme_host_port() ->
?LET({Scheme, Host, Port},
- {scheme(), host(), int(1, 65535)},
+ {scheme(), host(), integer(1, 65535)},
begin
HostBin = list_to_binary(Host),
{[{Scheme, ?LOWER(HostBin), Port}],
@@ -2693,7 +2693,7 @@ parse_sec_websocket_version_req(SecWebSocketVersion) when byte_size(SecWebSocket
-ifdef(TEST).
prop_parse_sec_websocket_version_req() ->
?FORALL(Version,
- int(0, 255),
+ integer(0, 255),
Version =:= parse_sec_websocket_version_req(integer_to_binary(Version))).
parse_sec_websocket_version_req_test_() ->
@@ -2744,7 +2744,7 @@ ws_version_list_sep(<< $,, R/bits >>, Acc) -> ws_version_list(R, Acc).
-ifdef(TEST).
sec_websocket_version_resp() ->
?LET(L,
- non_empty(list({ows(), ows(), int(0, 255)})),
+ non_empty(list({ows(), ows(), integer(0, 255)})),
begin
<< _, SecWebSocketVersion/binary >> = iolist_to_binary(
[[OWS1, $,, OWS2, integer_to_binary(V)] || {OWS1, OWS2, V} <- L]),
@@ -2834,7 +2834,7 @@ te() ->
L2 = case Trail of
no_trailers -> L;
trailers ->
- Rand = random:uniform(length(L) + 1) - 1,
+ Rand = rand:uniform(length(L) + 1) - 1,
{Before, After} = lists:split(Rand, L),
Before ++ [{<<"trailers">>, undefined}|After]
end,
@@ -2847,7 +2847,6 @@ te() ->
).
prop_parse_te() ->
- random:seed(os:timestamp()),
?FORALL({Trail, L, TE},
te(),
begin