我有一个失败的测试。我做了一些更改,撤消了它们,再次运行我的测试。我没有失败,而是得到了这个。
我的所有.beam
文件都存在。我的git status
显示没有变化。
=====================================================
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
s:s 只是gen_server:call
. 我正在测试这个模块的其他模块。
-module(room).
-behaviour(gen_server).
-compile(export_all).
-include_lib("eunit/include/eunit.hrl").
testRoom() ->
{ok, R} = room:go(),
{ok, T, _} = s:s(R, {join, #{name => "Blandline", auth => "auth"}}),
{ok, T, _} = s:s(R, {join, #{name => "Kreutzer", auth => "auth"}}),
{R, T}.
firstMove_test() ->
{R, T} = testRoom(),
{ok, #{actions := _, board := _, clock := _}} = s:s(R, {play, T, {take, x, {1,2}}, {"Blandline", "auth"}}).
badMove_test() ->
{R, T} = testRoom(),
{error, invalid_input} = s:s(R, {play, T, {take, x, {1,2,3}}, {"Blandline", "auth"}}).
badAuth_test() ->
{R, T} = testRoom(),
{error, invalid_auth} = s:s(R, {play, T, {take, x, {1,2}}, {"Blandline", "badauth"}}).
badTable_test() ->
{R, _} = testRoom(),
{error, bad_table} = s:s(R, {play, self(), {take, x, {1,2}}, {"Blandline", "badauth"}}).