MCPcopy Create free account
hub / github.com/TankHQ/tank / interval_parse

Function interval_parse

tests/value.rs:2138–2149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2136
2137 #[test]
2138 fn interval_parse() {
2139 use tank_core::Interval;
2140 let i = Interval::parse("'1 year 2 months 3 days'").unwrap();
2141 assert_eq!(i.months, 14); // 12 + 2
2142 assert_eq!(i.days, 3);
2143
2144 let i2 = Interval::parse("5 hours 30 minutes").unwrap();
2145 assert!(!i2.is_zero());
2146
2147 let i3 = Interval::parse("01:30:00").unwrap();
2148 assert!(!i3.is_zero());
2149 }
2150
2151 #[test]
2152 fn date_parse() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected