Please help me understand this!

I believe I had a miscarriage and when I called my doctor she told me to go to the er. So I did what I was told and explained everything showed them pictures. And the doctor made me take a pregnancy test to determine if I was pregnant..... if I did miscarry I told her I would've been at least 3 to 2 weeks. I don't understand why she would use a pregnancy test to see if I miscarried in the first place! It makes no sense to me!