Pregnancy test

How early can you take a pregnancy test before your period? My cycle doesn't start for another week and a half but I took a test and it was negative.