eproxus/meck

breaks on R20

Closed this issue · 1 comments

doesn't work with Erlang R20

Error output:

=== Location: [{meck_proc,start,96},
              {ergw_test_lib,meck_init,108},
              {ergw_test_lib,lib_init_per_suite,62},
              {test_server,ts_tc,1529},
              {test_server,run_test_case_eval1,1130},
              {test_server,run_test_case_eval,977}]
=== Reason: {compile_forms,
                  {error,
                   [{[],
                     [{none,compile,
                       {crash,lint_module,
                        {badarg,
                         [{erlang,atom_to_list,[[gen_server]],[]},
                          {erl_lint,is_latin1_name,1,
                           [{file,"erl_lint.erl"},{line,3055}]},
                          {erl_lint,check_module_name,3,
                           [{file,"erl_lint.erl"},{line,3048}]},
                          {erl_lint,behaviour_callbacks,3,
                           [{file,"erl_lint.erl"},{line,973}]},
                          {erl_lint,all_behaviour_callbacks,3,
                           [{file,"erl_lint.erl"},{line,934}]},
                          {erl_lint,behaviour_check,2,
                           [{file,"erl_lint.erl"},{line,921}]},
                          {erl_lint,post_traversal_check,2,
                           [{file,"erl_lint.erl"},{line,893}]},
                          {erl_lint,module,3,
                           [{file,"erl_lint.erl"},{line,536}]}]}}}]}],
                   []}}
  in function  meck_proc:start/2
     called as meck_proc:start(gtp_socket,[passthrough,no_link])
  in call from ergw_test_lib:meck_init/1 (ergw_test_lib.erl, line 108)
  in call from ergw_test_lib:lib_init_per_suite/1 (ergw_test_lib.erl, line 62)
  in call from test_server:ts_tc/3 (test_server.erl, line 1529)
  in call from test_server:run_test_case_eval1/6 (test_server.erl, line 1130)
  in call from test_server:run_test_case_eval/9 (test_server.erl, line 977)

The project I'm running this on is https://github.com/travelping/ergw

Versions

  • Meck version: git HEAD (ad8374c)
  • Erlang version: 20.0.0

I've traced the problem to this OTP commit: erlang/otp@340be6a

The behavior attribute really should only contain a single atom, however the module attribute contains a list of behaviors. With the introduction of UTF8 atoms, the linter now check that the module names are valid. Before that change the list in the behavior attribute would simply pass through, but the check now catches it as invalid.