@@ -283,6 +283,7 @@ fn test_bytea_params() {
283283}
284284
285285#[test]
286+ #[cfg(not(travis))] // Travis runs Postgres 9.1
286287fn test_json_params() {
287288 test_type(" JSON ", [(Some(json::from_str(" [ 10 , 11 , 12 ] ").unwrap()),
288289 " ' [ 10 , 11 , 12 ] ' "),
@@ -418,7 +419,8 @@ fn test_plaintext_pass_no_pass() {
418419 let ret = PostgresConnection :: try_connect( "postgres://pass_user@localhost" ) ;
419420 match ret {
420421 Err ( MissingPassword ) => ( ) ,
421- ret => fail!( "Unexpected result %?" , ret)
422+ Err ( err) => fail2!( "Unexpected error {}" , err. to_str( ) ) ,
423+ _ => fail2!( "Expected error" )
422424 }
423425}
424426
@@ -427,7 +429,8 @@ fn test_plaintext_pass_wrong_pass() {
427429 let ret = PostgresConnection :: try_connect( "postgres://pass_user:asdf@localhost" ) ;
428430 match ret {
429431 Err ( DbError ( PostgresDbError { code: InvalidPassword , _ } ) ) => ( ) ,
430- ret => fail!( "Unexpected result %?" , ret)
432+ Err ( err) => fail2!( "Unexpected error {}" , err. to_str( ) ) ,
433+ _ => fail2!( "Expected error" )
431434 }
432435}
433436
@@ -441,7 +444,8 @@ fn test_md5_pass_no_pass() {
441444 let ret = PostgresConnection :: try_connect( "postgres://md5_user@localhost" ) ;
442445 match ret {
443446 Err ( MissingPassword ) => ( ) ,
444- ret => fail!( "Unexpected result %?" , ret)
447+ Err ( err) => fail2!( "Unexpected error {}" , err. to_str( ) ) ,
448+ _ => fail2!( "Expected error" )
445449 }
446450}
447451
@@ -450,7 +454,8 @@ fn test_md5_pass_wrong_pass() {
450454 let ret = PostgresConnection :: try_connect( "postgres://md5_user:asdf@localhost" ) ;
451455 match ret {
452456 Err ( DbError ( PostgresDbError { code: InvalidPassword , _ } ) ) => ( ) ,
453- ret => fail!( "Unexpected result %?" , ret)
457+ Err ( err) => fail2!( "Unexpected error {}" , err. to_str( ) ) ,
458+ _ => fail2!( "Expected error" )
454459 }
455460}
456461
@@ -459,6 +464,7 @@ fn test_dns_failure() {
459464 let ret = PostgresConnection :: try_connect( "postgres://postgres@asdfasdfasdf" ) ;
460465 match ret {
461466 Err ( DnsError ) => ( ) ,
462- ret => fail!( "Unexpected result %?" , ret)
467+ Err ( err) => fail2!( "Unexpected error {}" , err. to_str( ) ) ,
468+ _ => fail2!( "Expected error" )
463469 }
464470}
0 commit comments