@@ -11,7 +11,7 @@ use postgres::types::{ToSql, FromSql, PgInt4, PgVarchar};
1111
1212#[ test]
1313fn test_prepare_err( ) {
14- let conn = PostgresConnection :: connect ( "postgres://postgres@127.0.0.1:5432 " ) ;
14+ let conn = PostgresConnection :: connect ( "postgres://postgres@127.0.0.1" ) ;
1515 match conn. try_prepare ( "invalid sql statment" ) {
1616 Err ( PostgresDbError { position, code, _ } ) => {
1717 assert_eq!( code, ~"42601 ");
@@ -26,7 +26,7 @@ fn test_prepare_err() {
2626
2727#[test]
2828fn test_transaction_commit() {
29- let conn = PostgresConnection::connect(" postgres: //postgres@127.0.0.1:5432 ");
29+ let conn = PostgresConnection::connect(" postgres: //postgres@127.0.0.1");
3030 conn. update( "CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)" , [ ] ) ;
3131
3232 do conn. in_transaction |trans| {
@@ -41,7 +41,7 @@ fn test_transaction_commit() {
4141
4242#[ test]
4343fn test_transaction_rollback( ) {
44- let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1:5432 " ) ;
44+ let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1" ) ;
4545 conn. update( "CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)" , [ ] ) ;
4646
4747 conn. update( "INSERT INTO foo (id) VALUES ($1)" , [ & 1i32 as & ToSql ] ) ;
@@ -58,7 +58,7 @@ fn test_transaction_rollback() {
5858
5959#[ test]
6060fn test_nested_transactions( ) {
61- let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1:5432 " ) ;
61+ let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1" ) ;
6262 conn. update( "CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)" , [ ] ) ;
6363
6464 conn. update( "INSERT INTO foo (id) VALUES (1)" , [ ] ) ;
@@ -100,7 +100,7 @@ fn test_nested_transactions() {
100100
101101#[ test]
102102fn test_query( ) {
103- let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1:5432 " ) ;
103+ let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1" ) ;
104104 conn. update( "CREATE TEMPORARY TABLE foo (id BIGINT PRIMARY KEY)" , [ ] ) ;
105105 conn. update( "INSERT INTO foo (id) VALUES ($1), ($2)" ,
106106 [ & 1i64 as & ToSql , & 2i64 as & ToSql ] ) ;
@@ -112,7 +112,7 @@ fn test_query() {
112112
113113#[ test]
114114fn test_lazy_query( ) {
115- let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1:5432 " ) ;
115+ let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1" ) ;
116116
117117 do conn. in_transaction |trans| {
118118 trans. update( "CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY)" , [ ] ) ;
@@ -132,22 +132,22 @@ fn test_lazy_query() {
132132
133133#[ test]
134134fn test_param_types( ) {
135- let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1:5432 " ) ;
135+ let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1" ) ;
136136 let stmt = conn. prepare( "SELECT $1::INT, $2::VARCHAR" ) ;
137137 assert_eq!( stmt. param_types( ) , [ PgInt4 , PgVarchar ] ) ;
138138}
139139
140140#[ test]
141141fn test_result_descriptions( ) {
142- let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1:5432 " ) ;
142+ let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1" ) ;
143143 let stmt = conn. prepare( "SELECT 1::INT as a, 'hi'::VARCHAR as b" ) ;
144144 assert_eq!( stmt. result_descriptions( ) ,
145145 [ ResultDescription { name: ~"a", ty: PgInt4},
146146 ResultDescription { name: ~" b", ty: PgVarchar}]);
147147}
148148
149149fn test_type<T: Eq+ToSql+FromSql>(sql_type: &str, values: &[T]) {
150- let conn = PostgresConnection::connect(" postgres: //postgres@127.0.0.1:5432 ");
150+ let conn = PostgresConnection::connect(" postgres: //postgres@127.0.0.1");
151151 conn. update( "CREATE TEMPORARY TABLE foo (
152152 id SERIAL PRIMARY KEY,
153153 b " + sql_type +
@@ -218,7 +218,7 @@ fn test_text_params() {
218218
219219#[test]
220220fn test_bpchar_params() {
221- let conn = PostgresConnection::connect(" postgres: //postgres@127.0.0.1:5432 ");
221+ let conn = PostgresConnection::connect(" postgres: //postgres@127.0.0.1");
222222 conn. update( "CREATE TEMPORARY TABLE foo (
223223 id SERIAL PRIMARY KEY,
224224 b CHAR(5)
@@ -252,7 +252,7 @@ fn test_uuid_params() {
252252}
253253
254254fn test_nan_param<T: Float+ToSql+FromSql>(sql_type: &str) {
255- let conn = PostgresConnection::connect(" postgres: //postgres@127.0.0.1:5432 ");
255+ let conn = PostgresConnection::connect(" postgres: //postgres@127.0.0.1");
256256 let nan: T = Float :: NaN ( ) ;
257257 let stmt = conn. prepare( "SELECT $1::" + sql_type) ;
258258 let mut result = stmt. query( [ & nan as & ToSql ] ) ;
@@ -273,13 +273,13 @@ fn test_f64_nan_param() {
273273#[ test]
274274#[ should_fail]
275275fn test_wrong_param_type( ) {
276- let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1:5432 " ) ;
276+ let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1" ) ;
277277 conn. try_update( "SELECT $1::VARCHAR" , [ & 1i32 as & ToSql ] ) ;
278278}
279279
280280#[ test]
281281fn test_find_col_named( ) {
282- let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1:5432 " ) ;
282+ let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1" ) ;
283283 let stmt = conn. prepare( "SELECT 1 as my_id, 'hi' as val" ) ;
284284 assert_eq!( Some ( 0 ) , stmt. find_col_named( "my_id" ) ) ;
285285 assert_eq!( Some ( 1 ) , stmt. find_col_named( "val" ) ) ;
@@ -288,7 +288,7 @@ fn test_find_col_named() {
288288
289289#[ test]
290290fn test_get_named( ) {
291- let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1:5432 " ) ;
291+ let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1" ) ;
292292 let stmt = conn. prepare( "SELECT 10::INT as val" ) ;
293293 let result = stmt. query( [ ] ) ;
294294
@@ -298,7 +298,7 @@ fn test_get_named() {
298298#[ test]
299299#[ should_fail]
300300fn test_get_named_fail( ) {
301- let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1:5432 " ) ;
301+ let conn = PostgresConnection :: connect( "postgres://postgres@127.0.0.1" ) ;
302302 let stmt = conn. prepare( "SELECT 10::INT as id" ) ;
303303 let mut result = stmt. query( [ ] ) ;
304304
@@ -307,12 +307,12 @@ fn test_get_named_fail() {
307307
308308#[ test]
309309fn test_plaintext_pass( ) {
310- PostgresConnection :: connect( "postgres://pass_user:password@127.0.0.1:5432 " ) ;
310+ PostgresConnection :: connect( "postgres://pass_user:password@127.0.0.1" ) ;
311311}
312312
313313#[ test]
314314fn test_plaintext_pass_no_pass( ) {
315- let ret = PostgresConnection :: try_connect( "postgres://pass_user@127.0.0.1:5432 " ) ;
315+ let ret = PostgresConnection :: try_connect( "postgres://pass_user@127.0.0.1" ) ;
316316 match ret {
317317 Err ( MissingPassword ) => ( ) ,
318318 ret => fail!( "Unexpected result %?" , ret)
@@ -321,7 +321,7 @@ fn test_plaintext_pass_no_pass() {
321321
322322#[ test]
323323fn test_plaintext_pass_wrong_pass( ) {
324- let ret = PostgresConnection :: try_connect( "postgres://pass_user:asdf@127.0.0.1:5432 " ) ;
324+ let ret = PostgresConnection :: try_connect( "postgres://pass_user:asdf@127.0.0.1" ) ;
325325 match ret {
326326 Err ( DbError ( PostgresDbError { code: ~"28 P01 ", _ })) => (),
327327 ret => fail!(" Unexpected result %?", ret)
@@ -330,12 +330,12 @@ fn test_plaintext_pass_wrong_pass() {
330330
331331#[test]
332332fn test_md5_pass() {
333- PostgresConnection::connect(" postgres: //md5_user:password@127.0.0.1:5432 ");
333+ PostgresConnection::connect(" postgres: //md5_user:password@127.0.0.1");
334334}
335335
336336#[ test]
337337fn test_md5_pass_no_pass( ) {
338- let ret = PostgresConnection :: try_connect( "postgres://md5_user@127.0.0.1:5432 " ) ;
338+ let ret = PostgresConnection :: try_connect( "postgres://md5_user@127.0.0.1" ) ;
339339 match ret {
340340 Err ( MissingPassword ) => ( ) ,
341341 ret => fail!( "Unexpected result %?" , ret)
@@ -344,7 +344,7 @@ fn test_md5_pass_no_pass() {
344344
345345#[ test]
346346fn test_md5_pass_wrong_pass( ) {
347- let ret = PostgresConnection :: try_connect( "postgres://md5_user:asdf@127.0.0.1:5432 " ) ;
347+ let ret = PostgresConnection :: try_connect( "postgres://md5_user:asdf@127.0.0.1" ) ;
348348 match ret {
349349 Err ( DbError ( PostgresDbError { code: ~"28 P01 ", _ })) => (),
350350 ret => fail!(" Unexpected result %?" , ret)
0 commit comments