0.0.6-SNAPSHOT fixed block indexes in merge3 result

This commit is contained in:
Sergey Chernov 2023-04-11 13:20:34 +01:00
parent ce3987d009
commit 2e19e8ca42
4 changed files with 34 additions and 2 deletions

View File

@ -4,7 +4,7 @@ plugins {
}
group = "net.sergeych"
version = "0.0.5-SNAPSHOT"
version = "0.0.6-SNAPSHOT"
repositories {
mavenCentral()

View File

@ -52,6 +52,11 @@
"@jridgewell/resolve-uri" "3.1.0"
"@jridgewell/sourcemap-codec" "1.4.14"
"@js-joda/core@3.2.0":
version "3.2.0"
resolved "https://registry.yarnpkg.com/@js-joda/core/-/core-3.2.0.tgz#3e61e21b7b2b8a6be746df1335cf91d70db2a273"
integrity sha512-PMqgJ0sw5B7FKb2d5bWYIoxjri+QlW/Pys7+Rw82jSH0QN3rB05jZ/VrrsUdh1w4+i2kw9JOejXGq/KhDOX7Kg==
"@socket.io/component-emitter@~3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz#96116f2a912e0c02817345b3c10751069920d553"
@ -598,6 +603,14 @@ dom-serialize@^2.2.1:
extend "^3.0.0"
void-elements "^2.0.0"
dukat@0.5.8-rc.4:
version "0.5.8-rc.4"
resolved "https://registry.yarnpkg.com/dukat/-/dukat-0.5.8-rc.4.tgz#90384dcb50b14c26f0e99dae92b2dea44f5fce21"
integrity sha512-ZnMt6DGBjlVgK2uQamXfd7uP/AxH7RqI0BL9GLrrJb2gKdDxvJChWy+M9AQEaL+7/6TmxzJxFOsRiInY9oGWTA==
dependencies:
google-protobuf "3.12.2"
typescript "3.9.5"
ee-first@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
@ -862,6 +875,11 @@ glob@^7.1.3, glob@^7.1.7:
once "^1.3.0"
path-is-absolute "^1.0.0"
google-protobuf@3.12.2:
version "3.12.2"
resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.12.2.tgz#50ce9f9b6281235724eb243d6a83e969a2176e53"
integrity sha512-4CZhpuRr1d6HjlyrxoXoocoGFnRYgKULgMtikMddA9ztRyYR59Aondv2FioyxWVamRo0rF2XpYawkTCBEQOSkA==
graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9:
version "4.2.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3"
@ -1713,6 +1731,11 @@ type-is@~1.6.18:
media-typer "0.3.0"
mime-types "~2.1.24"
typescript@3.9.5:
version "3.9.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.5.tgz#586f0dba300cde8be52dd1ac4f7e1009c1b13f36"
integrity sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ==
ua-parser-js@^0.7.30:
version "0.7.34"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.34.tgz#afb439e2e3e394bdc90080acb661a39c685b67d7"

View File

@ -36,7 +36,12 @@ class MergeResult<T>(
start = r.endInclusive + 1
}
if (start < merged.size) {
result.add(MergedBlock.Unchanged(merged.slice(start until merged.size), sourceIndices[start]))
result.add(
MergedBlock.Unchanged(
merged.slice(start until merged.size),
sourceIndices.indexOf(start)
)
)
}
result
}

View File

@ -84,6 +84,10 @@ class BasicTest {
val b = "456 Hello".toList()
val m = merge3(src, b, a, true)
// println(m.toTrace(src))
// println(m.changedAreas)
// for( b in m.blocks )
// println(b)
val unchanged = m.blocks.last() as MergedBlock.Unchanged
println(unchanged)
assertEquals(0, unchanged.referenceIndex)