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 {
42
42
/// Return whether the offset was positive or negative. Primarily useful
43
43
/// in case the offset is specified as a negative zero.
44
44
pub fn sign ( & self ) -> char {
45
- self . raw . offset as u8 as char
45
+ self . raw . sign as u8 as char
46
46
}
47
47
}
48
48
@@ -112,3 +112,16 @@ impl Ord for IndexTime {
112
112
me. cmp ( & other)
113
113
}
114
114
}
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