You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by wi...@apache.org on 2020/01/13 19:42:25 UTC
[couchdb-mochiweb] 26/37: Remove compile(tuple_calls) from
test/mochiweb_http_tests
This is an automated email from the ASF dual-hosted git repository.
willholley pushed a commit to branch upstream
in repository https://gitbox.apache.org/repos/asf/couchdb-mochiweb.git
commit 344dd9305dfa8e1e2c19f85d462b919c9088abb2
Author: Bob Ippolito <bo...@redivi.com>
AuthorDate: Tue Mar 12 01:26:08 2019 +0000
Remove compile(tuple_calls) from test/mochiweb_http_tests
---
examples/hmac_api/README | 2 +-
test/mochiweb_http_tests.erl | 12 +++++++-----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/examples/hmac_api/README b/examples/hmac_api/README
index 3771323..d69821a 100644
--- a/examples/hmac_api/README
+++ b/examples/hmac_api/README
@@ -159,7 +159,7 @@ authorize/request/1 should be called in the loop of project_name_web.erl as per:
loop(Req, DocRoot) ->
Auth = hmac_api_lib:authorize_request(Req),
io:format("Auth is ~p~n", [Auth]),
- "/" ++ Path = Req:get(path),
+ "/" ++ Path = mochiweb_request:get(path, Req),
...
When this is done you are ready to test the api:
diff --git a/test/mochiweb_http_tests.erl b/test/mochiweb_http_tests.erl
index 1057755..8fbf0f3 100644
--- a/test/mochiweb_http_tests.erl
+++ b/test/mochiweb_http_tests.erl
@@ -7,8 +7,6 @@
-define(SHOULD_HAVE_BUG, false).
-endif.
--compile(tuple_calls).
-
has_acceptor_bug_test_() ->
{setup,
fun start_server/0,
@@ -29,9 +27,13 @@ has_acceptor_bug_tests(Server) ->
?_assertEqual(?SHOULD_HAVE_BUG, has_bug(Port, 10000))}].
responder(Req) ->
- Req:respond({200,
- [{"Content-Type", "text/html"}],
- ["<html><body>Hello</body></html>"]}).
+ mochiweb_request:respond(
+ {
+ 200,
+ [{"Content-Type", "text/html"}],
+ ["<html><body>Hello</body></html>"]
+ },
+ Req).
has_bug(Port, Len) ->
case