From 99693490b0c410211090c6b0393f0cffb16c9d9c Mon Sep 17 00:00:00 2001
From: Fuad Ismail <fuad1502@gmail.com>
Date: Wed, 11 Dec 2024 11:04:50 +0700
Subject: [PATCH] tests/dmesg: add since/until invalid time test.

---
 tests/by-util/test_dmesg.rs | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/by-util/test_dmesg.rs b/tests/by-util/test_dmesg.rs
index 073c0a5..b7f9b69 100644
--- a/tests/by-util/test_dmesg.rs
+++ b/tests/by-util/test_dmesg.rs
@@ -157,3 +157,16 @@ fn test_since_until() {
         .succeeds()
         .stdout_only_fixture("test_since_until.expected");
 }
+
+#[test]
+fn test_since_until_invalid_time() {
+    let options = ["--since", "--until"];
+    for option in options {
+        new_ucmd!()
+            .arg(format!("{option}=definitely-invalid"))
+            .fails()
+            .stderr_only(format!(
+                "dmesg: invalid time value \"definitely-invalid\"\n"
+            ));
+    }
+}