You can read the label of the sunglasses carefully to see if there are signs of UV. Some sunglasses label with UV400, some sunglasses label with UV 100% or UV protection. If you not find UV signs on the sunglasses or their labels, you shall not buy them because they may not shield your eyes from UV rays. As long as the sunglasses contains UV rays, it can protect the eyes from UVA, UVB.
Usually a good pair of sunglasses has a label on them saying "100% UV protection" or "UV 400" which means they can block all the UV rays, including both UVA and UVB. If there is no label on them, you'd better take them to any optical store to have them checked. They will be tested by a special machine called UV meter