From 492a0550b2260233f8716d9a0e91978bde5c4fb4 Mon Sep 17 00:00:00 2001 From: Adam Semenenko <152864218+adam-enko@users.noreply.github.com> Date: Tue, 5 Nov 2024 19:03:41 +0100 Subject: [PATCH] comparing fix binary data --- ...ShouldBeADirectoryWithSameContentAsTest.kt | Bin 2998 -> 5517 bytes .../src/testFixtures/kotlin/kotestFiles.kt | 22 ++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/dokka-runners/dokka-gradle-plugin/src/test/kotlin/utils/ShouldBeADirectoryWithSameContentAsTest.kt b/dokka-runners/dokka-gradle-plugin/src/test/kotlin/utils/ShouldBeADirectoryWithSameContentAsTest.kt index 7f7bb243beb9c7024a41a45de1f4a884c0546c23..a42ac3063e48fdde73aeeed7f606ff19c12d8a5f 100644 GIT binary patch literal 5517 zcmd5={chVf5Z8(pD7*(Ku)hw*&^mR@O0xWkc8HzWO;@CAlMKWDY808awaAh|(uv)o zk2dU)_6j?mBwLD-^mAJTgQ9qMzxyUFJ$YP$$FLjCSHho671*Zb)NIps;AgJ-!u3N5 zk_i?u_*HU<#-OG?E=3FBaqyxM2Yj4F=Ujw*1g9&cbLh=o4{tUzA@DsOO3qNtlM*hU zxf6sD6ZQvJr-aW&(b<{HCc+&BoGp|e$WqCl%_E_}kJwqHxKzxQk_+WWp=5FzErQX| z^@Adt7YWYfoO?{F6~YY{;SoL+8E39S6NO}IDxwSb6nSIZefOLna4FHwR0>T9{E(qB zb5~8-hzDHpL+&kv^v`*)x`yvU_=@*eX#PzM$9$xThkq`ps9< zBX`Dkqfqfs_2e-I1GbDUMSay+i57H)8vW6hGr3oFU7N(h z`>YvBW^Rm2Wo^B%9lru)cqaQO*k90|gkpedp!wLmYcE@fY`8JIGfXDN# zavYjOX(kh~MH!6$JP+%b+}MfKs#K#9mFJ zq~%B$2Bw5Rdl8OsJIEYw*X`!It92XZ_Y|4gQoQ(#zPzcx1)kyfSBVaAssBQ0s82n1 zKi){idQ5a>y5LeBZepJ~;J-vuCTSm4dK-&hXF|shPX`IsI+q@v7nthArORD_1y_qZ zL5t?9N;g=wTBQtMN!;0inzd~~RS!Em1>stvvp}d8L!IOK?0P=+LszWG(%V_qXkdDP z(x2$c>sQa;_J2Pf9BuxKextg+UKJA@Uu`5G^@MO&m91-4-`eU%->ACn&#!J2&DB`0 zy00R})$Qo&Zd_U2fB*F-X0ZTT`=PK@eg5+Fj$s&2-=GZs<_`=5Z(YMU!JA>23wlNl zdc=Y558oNa!Qs9KNVw2w1_?>ho8x5h%C*(QV=bzMVaJOkV|#@fCjT3w+pdd(cTCtQNFP=.joinToFormattedList(limit: Int = 10): String = joinToString("\n", limit = limit) { " - ${it.invariantSeparatorsPathString}" } + + +/** + * Read lines from a file, leniently. + * Handles text and binary data. + * + * ([kotlin.io.path.readLines] blows up when it reads binary files.) + */ +private fun Path.readByteLines(): List { + try { + inputStream().bufferedReader().use { reader -> + return generateSequence { reader.readLine() }.toList() + } + } catch (e: Exception) { + throw IOException("Could not read lines from $this", e) + } +}