File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ impl Time {
4242 /// Return whether the offset was positive or negative. Primarily useful
4343 /// in case the offset is specified as a negative zero.
4444 pub fn sign ( & self ) -> char {
45- self . raw . offset as u8 as char
45+ self . raw . sign as u8 as char
4646 }
4747}
4848
@@ -112,3 +112,16 @@ impl Ord for IndexTime {
112112 me. cmp ( & other)
113113 }
114114}
115+
116+ #[ cfg( test) ]
117+ mod tests {
118+ use crate :: Time ;
119+
120+ #[ test]
121+ fn smoke ( ) {
122+ assert_eq ! ( Time :: new( 1608839587 , -300 ) . seconds( ) , 1608839587 ) ;
123+ assert_eq ! ( Time :: new( 1608839587 , -300 ) . offset_minutes( ) , -300 ) ;
124+ assert_eq ! ( Time :: new( 1608839587 , -300 ) . sign( ) , '-' ) ;
125+ assert_eq ! ( Time :: new( 1608839587 , 300 ) . sign( ) , '+' ) ;
126+ }
127+ }
You can’t perform that action at this time.
0 commit comments