Copilot commented on code in PR #37465:
URL: https://github.com/apache/shardingsphere/pull/37465#discussion_r2641840139


##########
kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/sqlbuilder/ddl/column/PostgreSQLColumnPropertiesAppenderTest.java:
##########
@@ -237,6 +237,79 @@ void assertAppendCopiesInheritedFromTable() {
         assertThat(getSingleColumn(context).get("inheritedfromtable"), 
is("parent_table"));
     }
     
+    @Test
+    void assertNormalizeSequenceValuesRemovesGroupingSeparator() {
+        Map<String, Object> column = createTextColumnWithName("id");
+        column.put("attidentity", "a");
+        column.put("colconstype", "i");
+        column.put("seqincrement", "1");
+        column.put("seqstart", "1");
+        column.put("seqmin", "1");
+        column.put("seqmax", "2,147,483,647");
+        column.put("seqcache", "1");
+        Map<String, Object> context = new LinkedHashMap<>();
+        when(templateExecutor.executeByTemplate(context, 
"component/table/%s/get_columns_for_table.ftl")).thenReturn(Collections.emptyList());
+        when(templateExecutor.executeByTemplate(context, 
"component/columns/%s/properties.ftl")).thenReturn(Collections.singletonList(column));
+        when(templateExecutor.executeByTemplate(anyMap(), 
eq("component/columns/%s/edit_mode_types_multi.ftl"))).thenReturn(Collections.emptyList());
+        appender.append(context);
+        Map<String, Object> singleColumn = getSingleColumn(context);
+        assertThat(singleColumn.get("seqincrement"), is(1L));
+        assertThat(singleColumn.get("seqstart"), is(1L));
+        assertThat(singleColumn.get("seqmin"), is(1L));
+        assertThat(singleColumn.get("seqmax"), is(2147483647L));
+        assertThat(singleColumn.get("seqcache"), is(1L));
+    }

Review Comment:
   The test coverage for sequence value normalization is missing tests for 
negative numbers with grouping separators. While the implementation should 
handle this correctly based on the regex pattern, it would be valuable to add a 
test case like:
   ```
   column.put("seqmin", "-2,147,483,648");
   // expect: -2147483648L
   ```
   This would verify that negative values with locale formatting are properly 
normalized.



-- 
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]

Reply via email to