Fixed valid tests number generation on Mac OS X

test/valid-test.sh generates valid tests count incorrectly (at least on Mac OS X):

> ./valid-test.sh
ls: -1l: No such file or directory
1..      13
> uname -mrs
Darwin 14.0.0 x86_64