Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
已跳过Erlang eunit测试(无代码更改!)_Erlang_Eunit - Fatal编程技术网

已跳过Erlang eunit测试(无代码更改!)

已跳过Erlang eunit测试(无代码更改!),erlang,eunit,Erlang,Eunit,我考试不及格。我做了一些更改,解开它们,再次运行测试。我没有失败,而是得到了这个 我所有的.beam文件都存在。我的git状态未显示任何更改 ===================================================== Failed: 0. Skipped: 0. Passed: 0. One or more tests were cancelled. error 60> room:test(). =ERROR REPORT==== 14-Feb-2

我考试不及格。我做了一些更改,解开它们,再次运行测试。我没有失败,而是得到了这个

我所有的
.beam
文件都存在。我的
git状态
未显示任何更改

=====================================================
  Failed: 0.  Skipped: 0.  Passed: 0.
One or more tests were cancelled.
error
60> room:test().

=ERROR REPORT==== 14-Feb-2017::19:36:57 ===
** Generic server <0.1375.0> terminating
** Last message in was {join,#{auth => "auth",name => "Blandline"}}
** When Server state == {<0.1376.0>,<0.1379.0>,<0.1380.0>}
** Reason for termination ==
** {function_clause,
       [{table,terminate,
            [{{case_clause,{ok,#{x => "Blandline"}}},
              [{table,handle_call,3,[{file,"table.erl"},{line,15}]},
               {gen_server,try_handle_call,4,
                   [{file,"gen_server.erl"},{line,615}]},
               {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,647}]},
               {proc_lib,init_p_do_apply,3,
                   [{file,"proc_lib.erl"},{line,247}]}]},
             {<0.1376.0>,<0.1379.0>,<0.1380.0>}],
            [{file,"table.erl"},{line,47}]},
        {gen_server,try_terminate,3,[{file,"gen_server.erl"},{line,629}]},
        {gen_server,terminate,7,[{file,"gen_server.erl"},{line,795}]},
        {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
room: firstMove_test...*skipped*
undefined
*unexpected termination of test process*
::{function_clause,[{table,terminate,
                           [{{case_clause,{ok,#{x => "Blandline"}}},
                             [{table,handle_call,3,[...]},
                              {gen_server,try_handle_call,4,...},
                              {gen_server,handle_msg,...},
                              {proc_lib,...}]},
                            {<0.1376.0>,<0.1379.0>,<0.1380.0>}],
                           [{file,"table.erl"},{line,47}]},
                    {gen_server,try_terminate,3,
                                [{file,"gen_server.erl"},{line,629}]},
                    {gen_server,terminate,7,
                                [{file,"gen_server.erl"},{line,795}]},
                    {proc_lib,init_p_do_apply,3,
                              [{file,"proc_lib.erl"},{line,247}]}]}

=======================================================
  Failed: 0.  Skipped: 0.  Passed: 0.
One or more tests were cancelled.
error

正如错误报告所告诉您的:

[{{case_clause,{ok,#{x => "Blandline"}}},
    [{table,handle_call,3,[{file,"table.erl"},{line,15}]},
您在文件table.erl第15行中有一个不匹配的case子句:-)

我认为,尽管您取消了更改,但测试开始失败的原因是,您正在从Erlang shell运行测试,并且您的某些东西(如gen_服务器)仍在运行,但由于某些原因失败

换句话说,您的测试是不可重复的,因为它们没有正确地拆下所有依赖项,或者因为它们需要在运行测试之前在Erlang shell中手动启动外部依赖项,如此gen_服务器


我强烈建议不要使用erlangshell来运行测试。使用rebar3从终端构建和运行测试。这将迫使您处理所有依赖关系并进行健壮的测试。完成这项工作所需的时间将得到充分利用:-)

谢谢!我必须研究一下rebar3,我已经看过几次了。@quantumpotation我建议看看rebar3网站,在Erlang工厂用谷歌搜索EUnit演示文稿,有两个幻灯片比EUnit手册页更容易理解。另外,“为你学习一些Erlang,让你受益匪浅!”有一章是关于EUnit的。谢谢@marco.m。我正在尝试迁移到rebar3,但遇到一些困难:
[{{case_clause,{ok,#{x => "Blandline"}}},
    [{table,handle_call,3,[{file,"table.erl"},{line,15}]},