chia7712 commented on a change in pull request #9891:
URL: https://github.com/apache/kafka/pull/9891#discussion_r559938304



##########
File path: core/src/test/scala/unit/kafka/tools/DumpLogSegmentsTest.scala
##########
@@ -168,6 +168,19 @@ class DumpLogSegmentsTest {
     assertEquals(Map.empty, errors.shallowOffsetNotFound)
   }
 
+  @Test
+  def testDumpEmptyIndex(): Unit = {
+    val indexFile = new File(indexFilePath)
+    new PrintWriter(indexFile).close()
+    val expectOutput = s"$indexFile is empty.\n"
+    val outContent = new ByteArrayOutputStream()
+    Console.withOut(outContent) {
+      DumpLogSegments.dumpIndex(indexFile, indexSanityOnly = false, verifyOnly 
= true,
+        misMatchesForIndexFilesMap = mutable.Map[String, List[(Long, 
Long)]](), Int.MaxValue)
+    }
+    assertEquals(outContent.toString, expectOutput)

Review comment:
       ```expectOutput``` should be moved to first argument.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to