Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 4 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
Commits on Apr 22, 2012
@samuelrivas samuelrivas avoid ugly line break in documentation line a9ad974
@kostis kostis Merge pull request #37 from samuelrivas/doc-fixes
avoid ugly line break in documentation line
deeb575
@samuelrivas samuelrivas don't clean the stacktrace if the error is in the use of proper funct…
…ions

Otherwise, the next error (not tested, is a simplification of an actually
failing test), with a wrong call to the invalid proper_fs:run_commands/1:

prop_bad_fsm() ->
    ?FORALL(
       Cmds, proper_fsm:commands(?MODULE),
       {H, S, R} = proper_fsm:run_commands(Cmds),
       ?WHENFAIL(report_error(H, S, R), R =:= ok)).

Will fail with undef and an empty stracktrace, which is confusing enough to
drain some time debugging it:

!
Failed: After 1 test(s).
An exception was raised: error:undef.
Stacktrace: [].
[]
c09f24f
@kostis kostis Merge pull request #36 from samuelrivas/fix-stacktrace-cleanup
don't clean the stacktrace if the error is a bad use of a proper function
91dce2b
Showing with 9 additions and 3 deletions.
  1. +6 −1 src/proper.erl
  2. +3 −2 src/proper_types.erl
View
7 src/proper.erl
@@ -1399,7 +1399,12 @@ threw_exception_aux(Fun, TopMod, TopName, TopArgs) ->
-spec clean_stacktrace(stacktrace()) -> stacktrace().
clean_stacktrace(RawTrace) ->
{Trace,_Rest} = lists:splitwith(fun is_not_proper_call/1, RawTrace),
- Trace.
+ %% If the clean trace is empty it's probably because of a bad call to
+ %% the proper API, so we let the whole stacktrace through
+ case Trace of
+ [] -> RawTrace;
+ _ -> Trace
+ end.
-spec is_not_proper_call(call_record()) -> boolean().
-ifdef(OLD_STACKTRACE_FORMAT).
View
5 src/proper_types.erl
@@ -1185,8 +1185,9 @@ resize(NewSize, RawType) ->
end.
%% @doc This is a predefined constraint that can be applied to random-length
-%% list and binary types (e.g. {@link list/0}, {@link string/0},
-%% {@link binary/0}) to ensure that the produced values are never empty.
+%% list and binary types to ensure that the produced values are never empty.
+%%
+%% e.g. {@link list/0}, {@link string/0}, {@link binary/0})
-spec non_empty(ListType::raw_type()) -> proper_types:type().
non_empty(RawListType) ->
?SUCHTHAT(L, RawListType, L =/= [] andalso L =/= <<>>).

No commit comments for this range

Something went wrong with that request. Please try again.