TST: better testing for test_where (GH8997)

closes #8997