If you apply to an automation testing position, please make sure your code submission is at least syntactically correct. I do not really expect perfect code but try to keep the overall bug count to a minimum. You have plenty of time to polish your code submission before you apply, please use it wisely.
Buggy code will not in itself result in disqualification. But it will provide some interesting fodder for the phone screen. I will ask how you tested this code. I will also ask you to walk me through some of it to see whether you can find a few of the problems on your own. This is not much different from the whiteboard coding exercises you'll get during an on-site interview.
I'm not a mean guy; I want you to succeed. So you really need to put your best foot forward.