* insertion.
*/
public void testStructuralDeletionVsInsert() {
// A's deletion engulfs B's insertion
new ReversibleTestParameters(
new DocOpBuilder()
.retain(2)
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("ab")
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("cdefg")
.deleteElementEnd()
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("hi")
.deleteElementEnd()
.deleteElementEnd()
.retain(3)
.build(),
DocOpCreator.insertCharacters(20, 6, "hello"),
new DocOpBuilder()
.retain(2)
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("ab")
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("hellocdefg")
.deleteElementEnd()
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("hi")
.deleteElementEnd()
.deleteElementEnd()
.retain(3)
.build(),
DocOpCreator.identity(5)
).run();
// A's deletion engulfs B's insertion
new ReversibleTestParameters(
new DocOpBuilder()
.retain(2)
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("ab")
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("cdefg")
.deleteElementEnd()
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("hi")
.deleteElementEnd()
.deleteElementEnd()
.retain(3)
.build(),
DocOpCreator.insertCharacters(20, 7, "hello"),
new DocOpBuilder()
.retain(2)
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("ab")
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("chellodefg")
.deleteElementEnd()
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("hi")
.deleteElementEnd()
.deleteElementEnd()
.retain(3)
.build(),
DocOpCreator.identity(5)
).run();
// A's deletion engulfs B's insertion
new ReversibleTestParameters(
new DocOpBuilder()
.retain(2)
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("ab")
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("cdefg")
.deleteElementEnd()
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("hi")
.deleteElementEnd()
.deleteElementEnd()
.retain(3)
.build(),
DocOpCreator.insertCharacters(20, 16, "hello"),
new DocOpBuilder()
.retain(2)
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("ab")
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("cdefg")
.deleteElementEnd()
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("hi")
.deleteElementEnd()
.deleteCharacters("hello")
.deleteElementEnd()
.retain(3)
.build(),
DocOpCreator.identity(5)
).run();
// A's deletion spatially adjacent to and before B's insertion
new ReversibleTestParameters(
new DocOpBuilder()
.retain(2)
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("ab")
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("cdefg")
.deleteElementEnd()
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("hi")
.deleteElementEnd()
.deleteElementEnd()
.retain(3)
.build(),
DocOpCreator.insertCharacters(20, 17, "hello"),
new DocOpBuilder()
.retain(2)
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("ab")
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("cdefg")
.deleteElementEnd()
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("hi")
.deleteElementEnd()
.deleteElementEnd()
.retain(8)
.build(),
DocOpCreator.insertCharacters(5, 2, "hello")
).run();
// A's deletion spatially before B's insertion
new ReversibleTestParameters(
new DocOpBuilder()
.retain(2)
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("ab")
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("cdefg")
.deleteElementEnd()
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("hi")
.deleteElementEnd()
.deleteElementEnd()
.retain(3)
.build(),
DocOpCreator.insertCharacters(20, 18, "hello"),
new DocOpBuilder()
.retain(2)
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("ab")
.deleteElementStart("type", Attributes.EMPTY_MAP)
.deleteCharacters("cdefg")