diff options
Diffstat (limited to 'common/text/transform_test.go')
-rw-r--r-- | common/text/transform_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/common/text/transform_test.go b/common/text/transform_test.go index 992dd524c..10738aee7 100644 --- a/common/text/transform_test.go +++ b/common/text/transform_test.go @@ -41,3 +41,21 @@ func TestPuts(t *testing.T) { c.Assert(Puts("\nA\n"), qt.Equals, "\nA\n") c.Assert(Puts(""), qt.Equals, "") } + +func TestVisitLinesAfter(t *testing.T) { + const lines = `line 1 +line 2 + +line 3` + + var collected []string + + VisitLinesAfter(lines, func(s string) { + collected = append(collected, s) + }) + + c := qt.New(t) + + c.Assert(collected, qt.DeepEquals, []string{"line 1\n", "line 2\n", "\n", "line 3"}) + +} |