How to test circuit with AC mains voltage?
My circuit is 230 V BLDC driver using diode bridge to rectify 230 V AC to 230 V DC ...

No. The DC link voltage will be \$ 230 \sqrt 2 \ \text V \$.

When something go wrong it might really dangerous what should I do?


Use an isolation transformer.
Connect an incandescent lamp in series between the transformer supply and your test circuit. The lamp will allow the DC bus to charge up when the BLDC drive is switched off and will cause the voltage to drop when running. If a short-circuit should occur the lamp will go to full brightness.
You'll need to work out what lamp wattage you need to allow sufficient current to flow to run the motor unloaded. Your next problem will be finding the lamp.
Add a circuit breaker on the isolated side of the transformer.




simulate this circuit &ndash; Schematic created using CircuitLab
Figure 1. Possible test layout.
LAMP1 acts as a current limiter. Open SW1 while powering up and on initial unloaded trials. When you're happy that nothing bad is happening and the lamp doesn't glow full brightness then you can close the switch. Many variable frequency supplies use a similar arrangement to limit the power-on surge current due to the discharged capacitor as this might damage the rectifier. They'll use a resistor and a relay rather than a lamp and switch.
XMFR1 isolates the L + N so now you can ground your DC- and safely attach the scope earth clip there. The DC LINK+ will be dangerous. Take care.