This is a non issue.
Any self respecting girl and her family will not agree to a virginity test.
A girl who has lost her virginity and knows about it would not agree to it either.
If you are going for an arranged marriage then family of the girl will get very mad at you if you bring out virginity test as a condition for marriage.
So you have to accept the girl with her bad and good.
As for the philosophy of once a thief always a thief , history tells us about many many people who were criminal and once they got reformed they became best of the best. In recent history you would find many successful people with criminal background.
Losing virginity for whatever reason is a big issue but life is way bigger than lost virginity . If someone does not get hung around virginity ( pun intended) married life has much more to offer.
If you are in a romantic relationship and you really love her you will not care what she did in the past, that is real and unconditional love. Love is never conditional.