There is no special meaning, but if $str was empty, then
if [ $str == "test" ]
will replace anything in the test, and it will be like this:
if [ == "test" ]
which will be a syntax error. Adding X in front would resolve this, however, citing it like this
if [ "$str" == "test" ]
is a more readable and understandable way to achieve the same.
Soren source share