From f37004eefdddb7387de370d3137edf3617541b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Sat, 14 Sep 2024 13:14:10 -0300 Subject: [PATCH] types: duration: Add test for empty string and PT0S MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- xsd-types/src/types/duration.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xsd-types/src/types/duration.rs b/xsd-types/src/types/duration.rs index ccaffbe1..d8f5f566 100644 --- a/xsd-types/src/types/duration.rs +++ b/xsd-types/src/types/duration.rs @@ -301,6 +301,8 @@ mod tests { #[test] fn duration_parsing_test() { + assert_eq!(Duration::from_str(""), Duration::from_str("PT0S")); + check_valid("PT0S"); check_valid("P2Y6M5DT12H35M30S"); check_valid("P1DT2H"); check_valid("P20M");