11use std:: error:: Error ;
2- use postgres :: types:: { FromSql , IsNull , Kind , ToSql , Type } ;
2+ use postgres_shared :: types:: { FromSql , IsNull , Kind , ToSql , Type } ;
33use postgres_protocol:: { self as protocol, types} ;
44
55use { BoundSided , BoundType , Normalizable , Range , RangeBound } ;
@@ -116,6 +116,7 @@ mod test{
116116
117117use postgres:: { Connection , TlsMode } ;
118118use postgres:: types:: { FromSql , ToSql } ;
119+ #[ cfg( feature = "with-time" ) ]
119120use time:: { self , Timespec } ;
120121
121122macro_rules! test_range {
@@ -163,6 +164,7 @@ mod test{
163164test_range ! ( "INT8RANGE" , i64 , 100i64 , "100" , 200i64 , "200" )
164165}
165166
167+ #[ cfg( feature = "with-time" ) ]
166168fn test_timespec_range_params ( sql_type : & str ) {
167169fn t ( time : & str ) -> Timespec {
168170 time:: strptime ( time, "%Y-%m-%d" ) . unwrap ( ) . to_timespec ( )
@@ -173,11 +175,13 @@ mod test{
173175}
174176
175177#[ test]
178+ #[ cfg( feature = "with-time" ) ]
176179fn test_tsrange_params ( ) {
177180test_timespec_range_params ( "TSRANGE" ) ;
178181}
179182
180183#[ test]
184+ #[ cfg( feature = "with-time" ) ]
181185fn test_tstzrange_params ( ) {
182186test_timespec_range_params ( "TSTZRANGE" ) ;
183187}
0 commit comments