Hisoka-X commented on code in PR #8140:
URL: https://github.com/apache/seatunnel/pull/8140#discussion_r1857647897
##########
seatunnel-dist/src/test/java/org/apache/seatunnel/api/connector/MarkdownHeaderTest.java:
##########
@@ -41,6 +41,43 @@ public static void setup() {
docsDirectorys.add(Paths.get("..", "docs", "zh"));
}
+ @Test
+ public void testFileNameVerify() {
+ // Verify that the file names in the English and Chinese directories
are the same.
+ List<String> enFileName =
+ fileName(docsDirectorys.get(0)).stream()
+ .map(path -> path.replace("/en/", "/"))
+ .collect(Collectors.toList());
+ List<String> zhFileName =
+ fileName(docsDirectorys.get(1)).stream()
+ .map(path -> path.replace("/zh/", "/"))
+ .collect(Collectors.toList());
+
+ long equalCount =
enFileName.stream().filter(zhFileName::contains).count();
+ long equalIgnoreCaseCount =
+ enFileName.stream()
+ .map(String::toLowerCase)
+ .filter(
+ name ->
+ zhFileName.stream()
+ .map(String::toLowerCase)
+ .anyMatch(name::equals))
+ .count();
+
+ Assertions.assertEquals(equalCount, equalIgnoreCaseCount);
Review Comment:
Can we throw exception of the chinese doc name can not be found in english
version when doc not match?
##########
seatunnel-dist/src/test/java/org/apache/seatunnel/api/connector/MarkdownHeaderTest.java:
##########
@@ -41,6 +41,43 @@ public static void setup() {
docsDirectorys.add(Paths.get("..", "docs", "zh"));
}
+ @Test
+ public void testFileNameVerify() {
Review Comment:
```suggestion
public void testChineseDocFileNameContainsInEnglishVersionDoc() {
```
--
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]