LMnet commented on code in PR #23496:
URL: https://github.com/apache/kafka/pull/23496#discussion_r4076640919
##########
connect/api/src/test/java/org/apache/kafka/connect/data/ValuesTest.java:
##########
@@ -157,6 +157,33 @@ public void
shouldParseStringsBeginningWithFalseAsStrings() {
assertEquals("false]", schemaAndValue.value());
}
+ @Test
+ public void shouldParseStringsBeginningWithNumberAsStrings() {
+ for (String value : List.of("1::2", "1|2", "1,2", "-1}", "+1]",
"1.5:2.5")) {
+ SchemaAndValue schemaAndValue = Values.parseString(value);
+ assertEquals(Type.STRING, schemaAndValue.schema().type(), value);
+ assertEquals(value, schemaAndValue.value(), value);
+ }
+ }
+
+ @Test
+ public void shouldParseTemporalStringsWithTrailingTokensAsStrings() {
+ for (String value : List.of("2020-01-01:foo", "2020-01-01,x")) {
Review Comment:
I would also add other time formats to test:
* `2020-02-03T11:12:13.145Z}`
* `15:16:17.189Z,`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]