Browse Source

handle pg 9.0 version reply for connect_with_invalid_user

Anton Lebedevich 14 years ago
parent
commit
1aaf455b77
1 changed files with 6 additions and 2 deletions
  1. 6 2
      test_src/pgsql_tests.erl

+ 6 - 2
test_src/pgsql_tests.erl

@@ -29,11 +29,15 @@ connect_with_md5_test() ->
                   [{database, "epgsql_test_db1"}]]).
                   [{database, "epgsql_test_db1"}]]).
 
 
 connect_with_invalid_user_test() ->
 connect_with_invalid_user_test() ->
-    {error, invalid_authorization_specification} =
+    {error, Why} =
         pgsql:connect(?host,
         pgsql:connect(?host,
                       "epgsql_test_invalid",
                       "epgsql_test_invalid",
                       "epgsql_test_invalid",
                       "epgsql_test_invalid",
-                      [{port, ?port}, {database, "epgsql_test_db1"}]).
+                      [{port, ?port}, {database, "epgsql_test_db1"}]),
+    case Why of
+        invalid_authorization_specification -> ok; % =< 8.4
+        invalid_password                    -> ok  % >= 9.0
+    end.
 
 
 connect_with_invalid_password_test() ->
 connect_with_invalid_password_test() ->
     {error, Why} =
     {error, Why} =