Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{'EXIT', {badarg, [{unicode,characters_to_binary, ...}]}} in proper_gen_next.erl #190

Open
NoobsEnslaver opened this issue Mar 1, 2019 · 0 comments
Assignees

Comments

@NoobsEnslaver
Copy link

Erlang/OTP 20 [erts-9.3.3.7]
Proper 1.3.0 from Hex

Try to run prop with ?FORALL_TARGETED, get crash report:

{'EXIT',
 {badarg,
  [{unicode,characters_to_binary,
    [[#Fun<proper_gen_next.34.116828358>,
          1076,
      #Fun<proper_gen_next.34.116828358>,
          53,
      #Fun<proper_gen_next.34.116828358>,
          34,37125]],
    []},
   {proper_gen_next,
    '-let_gen_sa/1-fun-0-',6,
    [{file,
      "/home/ne/Projects/ersip/_build/test/lib/proper/src/proper_gen_next.erl"},
     {line,617}]},
   {proper_gen_next,
    restrict_generation,6,
    [{file,
      "/home/ne/Projects/ersip/_build/test/lib/proper/src/proper_gen_next.erl"},
     {line,198}]},
   {proper_gen_next,
    '-tuple_gen_sa/1-lc$^1/1-1-',
    2,
    [{file,
      "/home/ne/Projects/ersip/_build/test/lib/proper/src/proper_gen_next.erl"},
     {line,488}]},
   {proper_gen_next,
    '-tuple_gen_sa/1-lc$^1/1-1-',
    2,
    [{file,
      "/home/ne/Projects/ersip/_build/test/lib/proper/src/proper_gen_next.erl"},
     {line,489}]},
   {proper_gen_next,
    '-tuple_gen_sa/1-fun-2-',3,
    [{file,
      "/home/ne/Projects/ersip/_build/test/lib/proper/src/proper_gen_next.erl"},
     {line,482}]},
   {proper_gen_next,
    restrict_generation,6,
    [{file,
      "/home/ne/Projects/ersip/_build/test/lib/proper/src/proper_gen_next.erl"},
     {line,198}]},
   {proper_gen_next,
    '-let_gen_sa/1-fun-0-',6,
    [{file,
      "/home/ne/Projects/ersip/_build/test/lib/proper/src/proper_gen_next.erl"},
     {line,613}]}]}}

with just ?FORALL works fine.

prop test code:

prop_find_encoding_slowdown(opts) -> [noshrink].
prop_find_encoding_slowdown() ->
    ?FORALL_TARGETED(Msg, message(),
        begin
            T0 = erlang:monotonic_time(millisecond),
            _ = ersip_sipmsg:assemble_bin(Msg),
            T1 = erlang:monotonic_time(millisecond),
            EncodeTime = T1-T0,
            ?MAXIMIZE(EncodeTime),
            EncodeTime < 1000
        end).

Full code of generators may be found here:
https://github.com/NoobsEnslaver/ersip/blob/proper/test/prop_basic.erl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants