There are tests you can buy cheaply and legally. You should always sacrifice a pill or capsule from a batch to test it.
Even if you know the strength just having big amount around is risky - it's very hard to stop until you run out which at some point starts causing damage.
The biggest risk was probably driving to the drug dealer, these roads are dangerous.