use portable conditional expression in test.sh

[[ expression ]] is bash-specific, so we use [ expression ] instead.