Permalink
Browse files

improve warning notice test

  • Loading branch information...
1 parent 3895b7c commit fc434772276475ac4e5b0bed6b18ed4732502156 @wg committed Jan 5, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 test_src/pgsql_tests.erl
View
@@ -520,9 +520,15 @@ active_connection_closed_test() ->
warning_notice_test() ->
with_connection(
fun(C) ->
- {ok, _, _} = pgsql:squery(C, "select 'test\\n'"),
+ Q = "create function pg_temp.raise() returns void as $$
+ begin
+ raise warning 'oops';
+ end;
+ $$ language plpgsql;
+ select pg_temp.raise()",
+ [{ok, _, _}, _] = pgsql:squery(C, Q),
receive
- {pgsql, C, {notice, #error{code = <<"22P06">>}}} -> ok
+ {pgsql, C, {notice, #error{message = <<"oops">>}}} -> ok
after
100 -> erlang:error(didnt_receive_notice)
end

0 comments on commit fc43477

Please sign in to comment.