Pregnancy test?

I have irregular periods so idk when imma start but I had unprotected sex 2wks ago and I'm getting a little worried... when should I take a test?