예제 #1
0
                public void InsertThenDeleteExact()
                {
                    var textChange = TextChange.CreateReduced(
                        TextChange.NewInsert("cat"),
                        TextChange.NewDeleteLeft(3));

                    Assert.Equal("", textChange.AsInsert().Item);
                }
예제 #2
0
                public void InsertThenDeleteMore()
                {
                    var textChange = TextChange.CreateReduced(
                        TextChange.NewInsert("cat"),
                        TextChange.NewDeleteLeft(4));

                    Assert.Equal(1, textChange.AsDeleteLeft().Item);
                }
예제 #3
0
                public void DoubleDeleteRight()
                {
                    var textChange = TextChange.CreateReduced(
                        TextChange.NewDeleteRight(5),
                        TextChange.NewDeleteRight(6));

                    Assert.Equal(11, textChange.AsDeleteRight().Item);
                }
예제 #4
0
                public void DoubleInsert()
                {
                    var textChange = TextChange.CreateReduced(
                        TextChange.NewInsert("a"),
                        TextChange.NewInsert("b"));

                    Assert.Equal("ab", textChange.AsInsert().Item);
                }
예제 #5
0
                public void InsertThenDeletePartial()
                {
                    var textChange = TextChange.CreateReduced(
                        TextChange.NewInsert("cat"),
                        TextChange.NewDeleteLeft(2));

                    Assert.Equal("c", textChange.AsInsert().Text);
                }
예제 #6
0
                public void InsertAndDeleteLeft()
                {
                    var textChange = TextChange.CreateReduced(
                        TextChange.NewCombination(
                            TextChange.NewInsert("cat"),
                            TextChange.NewDeleteLeft(3)),
                        TextChange.NewDeleteRight(3));

                    Assert.Equal(3, textChange.AsDeleteRight().Item);
                }
예제 #7
0
                public void Issue1108()
                {
                    var textChange = TextChange.CreateReduced(
                        TextChange.NewInsert("pr"),
                        TextChange.NewCombination(
                            TextChange.NewDeleteLeft(2),
                            TextChange.NewInsert("protected")));

                    Assert.Equal("protected", textChange.AsInsert().Item);
                }