Skip to content
Permalink
Browse files
Remove compatibility for R15 and R16
Closes #198.
  • Loading branch information
eproxus committed Oct 8, 2018
1 parent 12572c1 commit 38b25cc60e0a6d869c6fad0446517ac2f6e3a88a
Showing 5 changed files with 6 additions and 27 deletions.
@@ -8,8 +8,6 @@ otp_release:
- 19.3
- 18.3
- 17.5
- R16B03-1
- R15B03

script: rebar3 eunit
install:
@@ -266,7 +266,7 @@ If you or your company use Meck and find it useful, [donations][liberapay] are g
[hex]: https://hex.pm/packages/meck
[hex version badge]: https://img.shields.io/hexpm/v/meck.svg?style=flat-square
[hex license badge]: https://img.shields.io/hexpm/l/meck.svg?style=flat-square
[erlang version badge]: https://img.shields.io/badge/erlang-R15B03%20to%2021.0-blue.svg?style=flat-square
[erlang version badge]: https://img.shields.io/badge/erlang-17%20-%2021-blue.svg?style=flat-square
[build tool]: https://img.shields.io/badge/build%20tool-rebar3-orange.svg?style=flat-square
[liberapay badge]: https://img.shields.io/liberapay/receives/eproxus.svg?logo=liberapay&style=flat-square

@@ -1,16 +1,6 @@
{erl_opts, [
% Erlang releases after 17 don't put R in front of their name, and also
% require dict() to be written like dict:dict()
{platform_define, "^R", non_namespaced_types}, % used by meck
{platform_define, "^[0-9]+", namespaced_types} % used by hamcrest
]}.

{profiles, [
{test, [
{erl_opts, [
debug_info,
{platform_define, "^R(?!16B03)", cover_empty_compile_opts}
]},
{erl_opts, [debug_info]},
{cover_enabled, true},
{cover_opts, [verbose]}
]},
@@ -48,11 +48,7 @@
%%% Definitions
%%%============================================================================

-ifdef(non_namespaced_types). % For older Erlang versions
-type meck_dict() :: dict().
-else.
-type meck_dict() :: dict:dict().
-endif.

-record(state, {mod :: atom(),
can_expect :: any | [{Mod::atom(), Ari::byte()}],
@@ -1040,14 +1040,6 @@ cover_options_({_OldPath, Src, Module}) ->
% 2 instead of 3, as above
?assertEqual({ok, {Module, {2,0}}}, cover:analyze(Module, module)).

-ifdef(cover_empty_compile_opts).
-define(compile_options, []).
-else.
-define(compile_options, [
{i, test_include()},
{d, 'TEST', true}
]).
-endif.
cover_options_fail_({_OldPath, Src, Module}) ->
%% This may look like the test above but there is a subtle
%% difference. When `cover:compile_beam' is called it squashes
@@ -1066,7 +1058,10 @@ cover_options_fail_({_OldPath, Src, Module}) ->
proplists:delete(outdir, lists:sort(meck_code:compile_options(Module)))
),
{ok, _} = cover:compile_beam(Module),
?assertEqual(?compile_options, meck_code:compile_options(Module)),
?assertEqual(
[{i, test_include()}, {d, 'TEST', true}],
meck_code:compile_options(Module)
),
a = Module:a(),
b = Module:b(),
{1, 2} = Module:c(1, 2),

0 comments on commit 38b25cc

Please sign in to comment.