}
public void testMultiLineInsertVsDelete() throws Exception {
{
// Insertion above deletion
DocOp c = dob.rl(2).i(FIVE_N).rl(2).b();
DocOp s = dob.rl(3).d(TEN_N).b();
DocOp cPrime = dob.rl(2).i(FIVE_N).rl(1).b();
DocOp sPrime = dob.rl(4).d(TEN_N).b();
new ReversibleTestParameters(c, s, cPrime, sPrime).run();
}
{
// Insertion above deletion, but adjacent lines
DocOp c = dob.rl(2).i(FIVE_N).rl(1).b();
DocOp s = dob.rl(2).d(TEN_N).b();
DocOp cPrime = dob.rl(2).i(FIVE_N).b();
DocOp sPrime = dob.rl(3).d(TEN_N).b();
new ReversibleTestParameters(c, s, cPrime, sPrime).run();
}
{
// Insertion above/adjacent deletion (the last character of insertion is
// adjacent to first character of deletion)
DocOp c = dob.rl(2).i(FIVE_N).i(FIVE).eolR(11).rl(1).b();
DocOp s = dob.rl(2).d(TEN_N).d(TEN_N).b();
DocOp cPrime = dob.rl(2).i(FIVE_N).i(FIVE).b();
DocOp sPrime = dob.rl(3).r(5).d(TEN_N).d(TEN_N).b();
new ReversibleTestParameters(c, s, cPrime, sPrime).run();
}
{
// Insertion above/adjacent deletion (the last character of insertion is
// adjacent to first character of deletion)
DocOp c = dob.rl(2).i(FIVE_N).i(FIVE).eolR(11).rl(1).b();
DocOp s = dob.rl(2).d(TEN_N).d(TEN_N).b();
DocOp cPrime = dob.rl(2).i(FIVE_N).i(FIVE).b();
DocOp sPrime = dob.rl(3).r(5).d(TEN_N).d(TEN_N).b();
new ReversibleTestParameters(c, s, cPrime, sPrime).run();
}
{
// Insertion inside deletion
DocOp c = dob.rl(2).i(FIVE_N).i(FIVE_N).rl(2).b();
DocOp s = dob.d(TEN_N).d(TEN_N).d(TEN_N).d(TEN_N).b();
DocOp cPrime = dob.i(FIVE_N).i(FIVE_N).b();
DocOp sPrime = dob.d(TEN_N).d(TEN_N).rl(2).d(TEN_N).d(TEN_N).b();
new TestParameters(c, s, cPrime, sPrime).run();
}
{
// Insertion starts right after the last char deleted
DocOp c = dob.rl(1).r(10).i(FIVE_N).i(FIVE).eolR(2).rl(3).b();
DocOp s = dob.d(TEN_N).d(TEN).eolR(2).rl(3).b();
DocOp cPrime = dob.i(FIVE_N).i(FIVE).eolR(2).rl(3).b();
DocOp sPrime = dob.d(TEN_N).d(TEN).eolR(6).rl(4).b();
new TestParameters(c, s, cPrime, sPrime).run();
}
{
// Insertion starts on the line after the last line deleted
DocOp c = dob.rl(4).r(10).i(FIVE_N).i(FIVE).eolR(2).rl(3).b();
DocOp s = dob.d(TEN_N).d(TEN).eolR(2).rl(6).b();
DocOp cPrime = dob.rl(3).r(10).i(FIVE_N).i(FIVE).eolR(2).rl(3).b();
DocOp sPrime = dob.d(TEN_N).d(TEN).eolR(2).rl(7).b();
new TestParameters(c, s, cPrime, sPrime).run();
}
{
// Insertion is later in the document
DocOp c = dob.rl(5).i(FIVE_N).i(FIVE_N).b();
DocOp s = dob.d(TEN_N).d(TEN_N).rl(3).b();
DocOp cPrime = dob.rl(3).i(FIVE_N).i(FIVE_N).b();
DocOp sPrime = dob.d(TEN_N).d(TEN_N).rl(5).b();
new TestParameters(c, s, cPrime, sPrime).run();
}
}