To diagnose this condition, a dermatologist gives the patient a physical exam. Some patients require a test called the sweat test. This involves coating some of their skin with a powder that turns purple when the skin gets wet. To find an underlying medical condition, other medical tests may be necessary.