go/src/bytes
Ben Hoyt 154e5abfcd bytes, strings: add tests for TrimLeftFunc and TrimRightFunc
When I was working on the fix for #31038 (make TrimSpace return nil on
all-space input) I noticed that there were no tests for TrimLeftFunc
and TrimRightFunc, including the funky nil behavior. So add some!

I've just reused the existing TrimFunc test cases for TrimLeftFunc and
TrimRightFunc, as well as adding new tests for the empty string and
all-trimmed cases (which test the nil-returning behavior of TrimFunc and
TrimLeftFunc).

Change-Id: Ib580d4364e9b3c91350305f9d9873080d7862904
Reviewed-on: https://go-review.googlesource.com/c/go/+/170061
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-03-29 14:16:35 +00:00
..
boundary_test.go bytes: reduce work in IndexNearPageBoundary test 2017-11-04 11:09:49 +00:00
buffer.go bytes: hoist error creation out of function 2019-02-26 22:57:25 +00:00
buffer_test.go bytes: clean up a test 2019-02-26 23:16:46 +00:00
bytes.go bytes: make TrimSpace return nil on all-space input 2019-03-27 13:52:52 +00:00
bytes_test.go bytes, strings: add tests for TrimLeftFunc and TrimRightFunc 2019-03-29 14:16:35 +00:00
compare_test.go bytes: vary the input alignment to Compare argument in compare_test.go 2018-10-11 04:45:18 +00:00
example_test.go bytes: add examples for ToTitleSpecial, ToUpperSpecial and ToLowerSpecial 2019-03-01 14:56:41 +00:00
export_test.go internal/bytealg: move Count to bytealg 2018-03-04 17:49:25 +00:00
reader.go bytes, strings: fix Reader.UnreadRune returning without error on a zero Reader 2018-10-29 20:07:25 +00:00
reader_test.go bytes, strings: fix Reader.UnreadRune returning without error on a zero Reader 2018-10-29 20:07:25 +00:00