It seems when you do the following:
test -n $VAR && echo helloworld
It's treating it as though the argument is not there:
test -n && echo helloworld
And, for some reason, when the argument is not supplied, it always runs the command afterwards (i.e. it displays helloworld). I tried this on another unuary operator and it did the same thing:
test -f $FILENAME && echo helloworld
I think if you want to have expected behavior you must quote the argument:
test -n "$VAR" && echo helloworld
test -f "$FILE" && echo helloworld
The above yields no message echoing to the screen.
As to is that expected behavior? I can't find it in the documentation anywhere, but, it seems fairly reproducible and consistent.