Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
strategy:
matrix:
otp:
- "25.0"
- "24.3"
- "24.0"
- "23.2"
Expand All @@ -44,7 +45,7 @@ jobs:
examples:
name: Test examples
runs-on: ubuntu-latest
container: erlang:24.3
container: erlang:25.0
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -54,7 +55,7 @@ jobs:
parallel-examples:
name: Test examples in parallel
runs-on: ubuntu-latest
container: erlang:24.3
container: erlang:25.0
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -64,7 +65,7 @@ jobs:
coverage:
name: Code coverage
runs-on: ubuntu-latest
container: erlang:24.3
container: erlang:25.0
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2010-2021 Manolis Papadakis <[email protected]>,
# Copyright 2010-2022 Manolis Papadakis <[email protected]>,
# Eirini Arvaniti <[email protected]>,
# and Kostis Sagonas <[email protected]>
#
Expand Down Expand Up @@ -49,7 +49,7 @@ dialyzer: .plt/proper_plt compile
dialyzer --plt $< -Wunmatched_returns ebin

.plt/proper_plt: .plt
dialyzer --build_plt --output_plt $@ --apps erts kernel stdlib compiler crypto syntax_tools eunit mnesia tools runtime_tools
dialyzer --build_plt --output_plt $@ --apps erts kernel stdlib compiler crypto syntax_tools mnesia tools runtime_tools

check_escripts:
./scripts/check_escripts.sh make_doc
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You can reach PropEr's developers in the following ways:
We welcome user contributions and feedback (comments, suggestions, feature
requests, bug reports, patches, etc.).

Copyright 2010-2021 by Manolis Papadakis, Eirini Arvaniti, and Kostis Sagonas.
Copyright 2010-2022 by Manolis Papadakis, Eirini Arvaniti, and Kostis Sagonas.

This program is distributed under the [GPL](http://www.gnu.org/licenses/gpl.html),
version 3 or later. Please see the [COPYING][license] file for details.
Expand Down Expand Up @@ -195,7 +195,7 @@ incompatibilities between the two tools by now.
<!-- Badges (alphabetically) -->
[codecov badge]: https://codecov.io/gh/proper-testing/proper/branch/master/graph/badge.svg
[commit badge]: https://img.shields.io/github/last-commit/proper-testing/proper.svg?style=flat-square
[erlang versions badge]: https://img.shields.io/badge/erlang-20.0%20to%2024.3-blue.svg?style=flat-square
[erlang versions badge]: https://img.shields.io/badge/erlang-20.0%20to%2025.0-blue.svg?style=flat-square
[hex pm badge]: https://img.shields.io/hexpm/v/proper.svg?style=flat
[license badge]: https://img.shields.io/github/license/proper-testing/proper.svg?style=flat-square
[release badge]: https://img.shields.io/github/release/proper-testing/proper.svg?style=flat-square
Expand Down
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
{post_hooks, [{clean, "./scripts/clean_doc.sh"}]}.

{dialyzer, [{warnings, [unmatched_returns, unknown]},
{plt_extra_apps, [erts, kernel, stdlib, compiler, crypto, syntax_tools, eunit]}]}.
{plt_extra_apps, [erts, kernel, stdlib, compiler, crypto, syntax_tools]}]}.

{project_plugins, [covertool]}.
{cover_export_enabled, true}.
Expand Down
26 changes: 23 additions & 3 deletions src/proper_gen.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%%% -*- coding: utf-8; erlang-indent-level: 2 -*-
%%% -------------------------------------------------------------------
%%% Copyright 2010-2020 Manolis Papadakis <[email protected]>,
%%% Copyright 2010-2022 Manolis Papadakis <[email protected]>,
%%% Eirini Arvaniti <[email protected]>
%%% and Kostis Sagonas <[email protected]>
%%%
Expand All @@ -19,7 +19,7 @@
%%% You should have received a copy of the GNU General Public License
%%% along with PropEr. If not, see <http://www.gnu.org/licenses/>.

%%% @copyright 2010-2020 Manolis Papadakis, Eirini Arvaniti and Kostis Sagonas
%%% @copyright 2010-2022 Manolis Papadakis, Eirini Arvaniti and Kostis Sagonas
%%% @version {@version}
%%% @author Manolis Papadakis

Expand Down Expand Up @@ -173,7 +173,7 @@ remove_parameters(Type) ->
'none' | {'ok',imm_instance()}) -> imm_instance().
generate(Type, 0, none) ->
Constraints = proper_types:get_prop(constraints, Type),
MFAs = [eunit_lib:fun_parent(C) || {C, true} <- Constraints],
MFAs = [fun_parent(C) || {C, true} <- Constraints],
throw({'$cant_generate', lists:usort(MFAs)});
generate(_Type, 0, {ok,Fallback}) ->
Fallback;
Expand Down Expand Up @@ -353,6 +353,26 @@ clean_instance_list([H|T]) -> [clean_instance(H) | clean_instance_list(T)];
clean_instance_list([]) -> [];
clean_instance_list(Other) -> clean_instance(Other).

%% @private
-spec fun_parent(fun()) -> mfa().
%% Get the name of the containing function for a fun. (This is encoded
%% in the name of the generated function that implements the fun.)
%%
%% NB: This is a function taken from eunit_lib's source code.
%% It was removed in 25.0 because it relies on undocumented behaviour.
fun_parent(F) ->
{module, M} = erlang:fun_info(F, module),
{name, N} = erlang:fun_info(F, name),
case erlang:fun_info(F, type) of
{type, external} ->
{arity, A} = erlang:fun_info(F, arity),
{M, N, A};
{type, local} ->
[$-|S] = atom_to_list(N),
[S2, T] = string:split(S, "/", trailing),
{M, list_to_atom(S2), element(1, string:to_integer(T))}
end.

%%-----------------------------------------------------------------------------
%% Basic type generators
%%-----------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions test/rec_test1.erl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%%% -*- coding: utf-8 -*-
%%% -*- erlang-indent-level: 2 -*-
%%% -------------------------------------------------------------------
%%% Copyright 2010-2019 Manolis Papadakis <[email protected]>,
%%% Copyright 2010-2022 Manolis Papadakis <[email protected]>,
%%% Eirini Arvaniti <[email protected]>
%%% and Kostis Sagonas <[email protected]>
%%%
Expand All @@ -20,13 +20,13 @@
%%% You should have received a copy of the GNU General Public License
%%% along with PropEr. If not, see <http://www.gnu.org/licenses/>.

%%% @copyright 2010-2019 Manolis Papadakis, Eirini Arvaniti and Kostis Sagonas
%%% @copyright 2010-2022 Manolis Papadakis, Eirini Arvaniti and Kostis Sagonas
%%% @version {@version}
%%% @author Manolis Papadakis
%%% @doc This module contains types for testing the typeserver.

-module(rec_test1).
-export_type([bb/0, expb/0, expc/0]).
-export_type([a/0, aa/0, bb/0, cc/0, deeplist/0, e/0, f/0, expb/0, expc/0]).

-type a() :: 'aleaf' | b() | [{'rec', a()}] | c() | d().
-type b() :: 'bleaf' | {'bnode', b(), b()}.
Expand Down
6 changes: 3 additions & 3 deletions test/rec_test2.erl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%%% -*- coding: utf-8 -*-
%%% -*- erlang-indent-level: 2 -*-
%%% -------------------------------------------------------------------
%%% Copyright 2010-2018 Manolis Papadakis <[email protected]>,
%%% Copyright 2010-2022 Manolis Papadakis <[email protected]>,
%%% Eirini Arvaniti <[email protected]>
%%% and Kostis Sagonas <[email protected]>
%%%
Expand All @@ -20,13 +20,13 @@
%%% You should have received a copy of the GNU General Public License
%%% along with PropEr. If not, see <http://www.gnu.org/licenses/>.

%%% @copyright 2010-2018 Manolis Papadakis, Eirini Arvaniti and Kostis Sagonas
%%% @copyright 2010-2022 Manolis Papadakis, Eirini Arvaniti and Kostis Sagonas
%%% @version {@version}
%%% @author Manolis Papadakis
%%% @doc This module contains types for testing the typeserver.

-module(rec_test2).
-export_type([b/0, expa/0]).
-export_type([aa/0, b/0, expa/0, rec/0]).

-type a() :: 'aleaf' | {'anode',b()}.
-opaque b() :: {'bnode',b()} | a().
Expand Down