Maybe your squares are too small to detect - assuming black is truly black and does not reflect IR, while the white is truly white and does reflect it. Indeed what your eyes see is not necessarily what the IR sensor sees - after all it's looking at a different colour of light.
This sensor has an IR LED that basically floods the surrounding (mostly in front of it but it's got a significant cone) and an IR photodiode which records whatever light comes back. It will detect the white next to a small black square.
It is also highly sensitive to ambient IR, thus will not work outdoors during the day (lots of IR also when it's cloudy), or close to heat sources such as incandescent lights.