64SCENARIO(
"Parsing times in x:m:s format",
"[tcsInterface]" )
66 GIVEN(
"A valid x:m:s string")
70 WHEN(
"Positive, double digit integers")
74 std::string tstr =
"12:20:50";
83 REQUIRE_THAT(x, Catch::Matchers::WithinAbs(12, 1e-10));
84 REQUIRE_THAT(m, Catch::Matchers::WithinAbs(20, 1e-10));
85 REQUIRE_THAT(s, Catch::Matchers::WithinAbs(50, 1e-10));
88 WHEN(
"Negative, double digit integers")
92 std::string tstr =
"-22:30:48";
101 REQUIRE_THAT(x, Catch::Matchers::WithinAbs(-22, 1e-10));
102 REQUIRE_THAT(m, Catch::Matchers::WithinAbs(-30, 1e-10));
103 REQUIRE_THAT(s, Catch::Matchers::WithinAbs(-48, 1e-10));
106 WHEN(
"Positive, double digit, decimal seconds")
110 std::string tstr =
"12:20:50.267849";
119 REQUIRE_THAT(x, Catch::Matchers::WithinAbs(12, 1e-10));
120 REQUIRE_THAT(m, Catch::Matchers::WithinAbs(20, 1e-10));
121 REQUIRE_THAT(s, Catch::Matchers::WithinAbs(50.267849, 1e-10));
124 WHEN(
"Negative, double digit integers")
128 std::string tstr =
"-22:30:48.8771819";
137 REQUIRE_THAT(x, Catch::Matchers::WithinAbs(-22, 1e-10));
138 REQUIRE_THAT(m, Catch::Matchers::WithinAbs(-30, 1e-10));
139 REQUIRE_THAT(s, Catch::Matchers::WithinAbs(-48.8771819, 1e-10));
143 GIVEN(
"Invalid x:m:s strings")
151 std::string tstr =
"";
166 std::string tstr =
"12-20-50";
181 std::string tstr =
"12:20-50";
192 WHEN(
"two :, but one at beginning")
196 std::string tstr =
":12:20";
207 WHEN(
"two :, but no m")
211 std::string tstr =
"12::20";
222 WHEN(
"two :, but one at end")
226 std::string tstr =
"12:20:";
241 std::string tstr =
"x:20:80";
256 std::string tstr =
"-x:20:80";
271 std::string tstr =
"20:m:80";
286 std::string tstr =
"-12:m:80";
301 std::string tstr =
"20:23:s.ssy";
316 std::string tstr =
"-12:23:s.sye";