TST: tests for GH5873

closes https://github.com/pydata/pandas/issues/5873

code changes were done in https://github.com/pydata/pandas/pull/9101 and https://github.com/pydata/pandas/pull/9061. just adding tests to confirm bugs reported there are handled.