File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- /.rust /
2- /build /
3- /bin /
41/doc /
5- /lib /
2+ /lib
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ use super::{PostgresNoticeHandler,
2121 PostgresDbError ,
2222 PostgresStatement ,
2323 ResultDescription } ;
24- use super :: error:: hack:: { SyntaxError , InvalidPassword , QueryCanceled } ;
24+ use super :: error:: hack:: { SyntaxError ,
25+ InvalidPassword ,
26+ QueryCanceled ,
27+ InvalidCatalogName } ;
2528use super :: types:: { ToSql , FromSql , PgInt4 , PgVarchar } ;
2629use super :: pool:: PostgresConnectionPool ;
2730
@@ -55,6 +58,11 @@ fn test_non_default_database() {
5558 PostgresConnection :: connect ( "postgres://postgres@localhost/postgres" ) ;
5659}
5760
61+ #[ test]
62+ fn test_url_terminating_slash ( ) {
63+ PostgresConnection :: connect ( "postgres://postgres@localhost/" ) ;
64+ }
65+
5866#[ test]
5967fn test_prepare_err ( ) {
6068 let conn = PostgresConnection :: connect ( "postgres://postgres@localhost" ) ;
@@ -64,6 +72,14 @@ fn test_prepare_err() {
6472 }
6573}
6674
75+ #[ test]
76+ fn test_unknown_database ( ) {
77+ match PostgresConnection :: try_connect ( "postgres://postgres@localhost/asdf" ) {
78+ Err ( DbError ( PostgresDbError { code : InvalidCatalogName , _ } ) ) => { }
79+ resp => fail ! ( "Unexpected result {:?}" , resp)
80+ }
81+ }
82+
6783#[ test]
6884fn test_transaction_commit ( ) {
6985 let conn = PostgresConnection :: connect ( "postgres://postgres@localhost" ) ;
You can’t perform that action at this time.
0 commit comments