Skip to content

Commit

Permalink
Add code formatter check to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
seriyps committed Dec 7, 2023
1 parent e190e7c commit 50943e9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
- name: Compile
run: rebar3 compile

- name: Format
run: rebar3 fmt --check

- name: Run Proper Tests
run: rebar3 proper -c

Expand Down
20 changes: 11 additions & 9 deletions test/prop_vs_lists.erl
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,22 @@ prop_filter() ->

prop_filtermap() ->
Gen = proper_types:list(
proper_types:oneof([
proper_types:integer(),
proper_types:binary(),
proper_types:atom()
])),
proper_types:oneof([
proper_types:integer(),
proper_types:binary(),
proper_types:atom()
])
),
?FORALL(
List,
Gen,
begin
ListIter = iterator:from_list(List),
F = fun(V) when is_integer(V) -> {true, V * 2};
(V) when is_binary(V) -> true;
(V) when is_atom(V) -> false
end,
F = fun
(V) when is_integer(V) -> {true, V * 2};
(V) when is_binary(V) -> true;
(V) when is_atom(V) -> false
end,
?assertEqual(
lists:filtermap(F, List),
iterator:to_list(iterator:filtermap(F, ListIter))
Expand Down

0 comments on commit 50943e9

Please sign in to comment.