buffer: refactor the trim left/right tests to use test data