Yay, back to the glory days of having repo tests.
The problem was that we weren't being smart about ##__DIR__.'/some/string'## during the compile step. Now we are.
I made a sample directory with a file, a symlink, a dir, a recursive symlink and an empty file. Hopefully that is enough edge cases.
I tried to find all the places that used weird files and ##test## in TCR and used this dir instead.