MCPcopy Create free account
hub / github.com/aws/clock-bound / test_duration_parse

Function test_duration_parse

clock-bound/src/daemon/time/inner/string_parse.rs:139–144  ·  view source on GitHub ↗
(#[case] input: &str, #[case] expected: i128)

Source from the content-addressed store, hash-verified

137 fn test_duration_parse(#[case] input: &str, #[case] expected: i64) {
138 let duration = Duration::parse_from_duration(input).unwrap();
139 assert_eq!(duration.as_nanos(), expected);
140 let instant = Instant::parse_from_duration(input).unwrap();
141 assert_eq!(instant.as_nanos(), expected);
142 }
143
144 #[rstest]
145 #[case::trimming(" 1s ", NANOS_PER_SEC)]
146 #[case::case_insensitivity("1S", NANOS_PER_SEC)]
147 #[case::uppercase("1SEC", NANOS_PER_SEC)]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected