Better test file detection