test fold edge cases

this fixes aphyr/riemann#163