From 7515d51f7f7cbb8a5dfbca9220057965e668e319 Mon Sep 17 00:00:00 2001 From: Stephen Searles Date: Wed, 9 Aug 2017 14:57:52 -0700 Subject: [PATCH] a few more minor tests --- acedoc_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/acedoc_test.go b/acedoc_test.go index 4ac7f4e..b68d3d7 100644 --- a/acedoc_test.go +++ b/acedoc_test.go @@ -285,6 +285,7 @@ func TestDelta2(t *testing.T) { } } + func TestDelta(t *testing.T) { type c struct { name string @@ -333,8 +334,20 @@ func TestDelta(t *testing.T) { {"remove part", "aa", "a", Remove(0, 0, "a")}, + {"remove other part", + "aa", "a", Remove(0, 1, "a")}, + {"remove across line", "a\nb", "a", Remove(0, 1, "\nb")}, + + {"remove across two lines", + "a\nb\nc", "ac", Remove(0, 1, "\nb\n")}, + + {"remove all across line", + "a\nb", "", Remove(0, 0, "a\nb")}, + + {"remove all across two lines", + "a\nb\nc", "", Remove(0, 0, "a\nb\nc")}, } for _, c := range cases {