Skip to content

Commit

Permalink
Fix the type of the {to_file, device()} option
Browse files Browse the repository at this point in the history
A user reported that user_opts() type does not contain: {'to_file', 'user'}
even though this option is the suggested way to integrate PropEr with EUnit.
The problem is that the type used file:io_device() instead of io:device().

Thanks to Matyas Markovics for reporting this issue.
  • Loading branch information
kostis committed Jan 30, 2014
1 parent c37cab8 commit da31c4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion THANKS
Expand Up @@ -22,8 +22,9 @@ bug reports that have also improved the quality of PropEr.

1. Geoff Cant
2. Jorge Diz Pico
3. Adam Rutkowski
...
N. Adam Rutkowski
N. Matyas Markovics

Apologies to those who we forgot to mention; we can assure you it's
not intentional, we are simply getting older... If you want to be
Expand Down
8 changes: 4 additions & 4 deletions src/proper.erl
Expand Up @@ -463,7 +463,7 @@
%% TODO: Rename this to 'options()'?
-type user_opt() :: 'quiet'
| 'verbose'
| {'to_file',file:io_device()}
| {'to_file',io:device()}
| {'on_output',output_fun()}
| 'long_result'
| {'numtests',pos_integer()}
Expand Down Expand Up @@ -736,7 +736,7 @@ counterexample(OuterTest) ->
%% @doc Same as {@link counterexample/1}, but also accepts a list of options.
-spec counterexample(outer_test(), user_opts()) -> long_result().
counterexample(OuterTest, UserOpts) ->
quickcheck(OuterTest, add_user_opt(long_result,UserOpts)).
quickcheck(OuterTest, add_user_opt(long_result, UserOpts)).

%% @private
%% @doc Runs PropEr in pure mode. Under this mode, PropEr will perform no I/O
Expand All @@ -752,9 +752,9 @@ pure_check(OuterTest) ->
pure_check(OuterTest, ImmUserOpts) ->
Parent = self(),
UserOpts = add_user_opt(quiet, ImmUserOpts),
spawn_link(fun() -> Parent ! {result,quickcheck(OuterTest,UserOpts)} end),
spawn_link(fun() -> Parent ! {result, quickcheck(OuterTest, UserOpts)} end),
receive
{result,Result} -> Result
{result, Result} -> Result
end.

%% @doc Tests the accuracy of an exported function's spec.
Expand Down

0 comments on commit da31c4b

Please sign in to comment.