|
|
@ -8,6 +8,23 @@ import kotlin.test.assertEquals |
|
|
|
import kotlin.test.assertNull |
|
|
|
import kotlin.test.assertNull |
|
|
|
|
|
|
|
|
|
|
|
class VersionTrailerTest { |
|
|
|
class VersionTrailerTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
fun testPeek() { |
|
|
|
|
|
|
|
assertNull(VersionTrailer.peek(Unpooled.EMPTY_BUFFER)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wrappedBuffer(0).use { buf -> |
|
|
|
|
|
|
|
assertNull(VersionTrailer.peek(buf)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wrappedBuffer(0x12, 0x34).use { buf -> |
|
|
|
|
|
|
|
assertEquals(0x1234, VersionTrailer.peek(buf)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wrappedBuffer(0x12, 0x34, 0x56).use { buf -> |
|
|
|
|
|
|
|
assertEquals(0x3456, VersionTrailer.peek(buf)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
fun testStrip() { |
|
|
|
fun testStrip() { |
|
|
|
assertNull(VersionTrailer.strip(Unpooled.EMPTY_BUFFER)) |
|
|
|
assertNull(VersionTrailer.strip(Unpooled.EMPTY_BUFFER)) |
|
|
|