mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 08:35:22 +00:00
added error message matching for fail tests
This commit is contained in:
parent
ffedf60096
commit
333bc02bf4
@ -76,6 +76,7 @@
|
|||||||
|
|
||||||
-define(FAIL_TESTS, [
|
-define(FAIL_TESTS, [
|
||||||
{
|
{
|
||||||
|
{1001,<<"The upper and lower boundaries are equal or adjacent. No results are possible.">>},
|
||||||
{">", "2016-08-02 10:19"},
|
{">", "2016-08-02 10:19"},
|
||||||
{"<", "2016-08-02 10:20"}
|
{"<", "2016-08-02 10:20"}
|
||||||
}
|
}
|
||||||
@ -112,14 +113,14 @@ confirm() ->
|
|||||||
end, ?PASS_TESTS),
|
end, ?PASS_TESTS),
|
||||||
|
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun({{Op1, String1}, {Op2, String2}}) ->
|
fun({{ErrCode, ErrMsg}, {Op1, String1}, {Op2, String2}}) ->
|
||||||
Qry = lists:flatten(
|
Qry = lists:flatten(
|
||||||
io_lib:format(QryFmt, [Op1, String1,
|
io_lib:format(QryFmt, [Op1, String1,
|
||||||
Op2, String2])),
|
Op2, String2])),
|
||||||
|
|
||||||
RetMsg = ts_util:single_query(Conn, Qry),
|
RetMsg = ts_util:single_query(Conn, Qry),
|
||||||
%% Assert that RetMsg returns a tuple with error in first place {error, {}}
|
ExpectMsg = {error, {ErrCode, ErrMsg}},
|
||||||
?assertMatch({error, {_ErrCode, _ErrMsg}}, RetMsg)
|
?assertMatch(ExpectMsg, RetMsg)
|
||||||
end, ?FAIL_TESTS),
|
end, ?FAIL_TESTS),
|
||||||
|
|
||||||
pass.
|
pass.
|
||||||
|
Loading…
Reference in New Issue
Block a user