Browse Source

Test new method

Sam Clements 2 years ago
parent
commit
404005c660
1 changed files with 10 additions and 1 deletions
  1. 10 1
      src/lib.rs

+ 10 - 1
src/lib.rs

@@ -113,7 +113,7 @@ impl SimpleLogger {
 
             #[cfg(feature = "timestamps")]
             timestamps: Timestamps::Utc,
-                
+
             #[cfg(feature = "timestamps")]
             timeformat: None,
 
@@ -625,6 +625,15 @@ mod test {
         assert!(builder.timestamps == Timestamps::Local);
     }
 
+    #[test]
+    #[cfg(feature = "timestamps")]
+    #[allow(deprecated)]
+    fn test_with_timeformat() {
+        let builder =
+            SimpleLogger::new().with_custom_timestamps(time::macros::format_description!("[hour]:[minute]:[second]"));
+        assert!(builder.timeformat.is_some());
+    }
+
     #[test]
     #[cfg(feature = "colored")]
     fn test_with_colors() {