| commit | 0a50dc0e5a012dbf22f1289471dc52bc0fe44e9a | [log] [tgz] |
|---|---|---|
| author | Keith Rarick <kr@xph.us> | Wed Feb 03 23:26:24 2016 -0800 |
| committer | Keith Rarick <kr@xph.us> | Wed Feb 03 23:26:24 2016 -0800 |
| tree | f63739fa4b35f6372c4b3d192a38d1391bbfd949 | |
| parent | 337b85fad309936c56882d5ba1d8e9ddf73cbb42 [diff] |
add test from #4
diff --git a/wrap_test.go b/wrap_test.go index 634b6e8..af55a0e 100644 --- a/wrap_test.go +++ b/wrap_test.go
@@ -60,3 +60,21 @@ } } } + +func TestWrapPr4(t *testing.T) { + cases := []struct { + limit int + text string + want string + }{ + {5, "aa aä", "aa aä"}, + {4, "aa aä", "aa\naä"}, + } + + for _, test := range cases { + got := Wrap(test.text, test.limit) + if got != test.want { + t.Errorf("Wrap(%q, %d) = %q want %q", test.text, test.limit, got, test.want) + } + } +}