Close stream properly in test
This commit is contained in:
parent
ebf608b2fa
commit
9fda246045
@ -30,8 +30,11 @@ class RegexCedictParserTest : ShouldSpec({
|
||||
val cedictFileStream = GZIPInputStream(javaClass.getResourceAsStream(cedictFilePath))
|
||||
|
||||
val cedictParser = RegexCedictParser()
|
||||
val cedictEntries = cedictParser.parseCedict(cedictFileStream)
|
||||
|
||||
cedictEntries.toList().size shouldBe 122_508
|
||||
cedictFileStream.use {
|
||||
val cedictEntries = cedictParser.parseCedict(cedictFileStream)
|
||||
|
||||
cedictEntries.toList().size shouldBe 122_508
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user