While you can typically wear sunglasses on a driving test, some examiners will ask you to remove them. This is because the dark glasses prevent the examiner from seeing whether or not you’re checking your mirrors as needed.
Additionally, dark glasses can make it harder to drive if it’s not bright enough outside, as sunglasses darken your view. In dim conditions, this limits visibility. So, unless it’s very bright and sunny on the day of your exam, it’s probably best to leave your sunglasses at home.