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.

merged via https://github.com/pydata/pandas/commit/28fc02a9eb285177143fb1b80e249fd75b6829b9
