Diagnosis of a corneal ulcer begins with a medical history and physical exam. A slit lamp exam uses a microscope and a rectangular light source to examine the cornea. Often, the cornea is stained with a dye called fluorescein. Scrapings from the cornea may be sent to a lab to determine if a fungus or bacteria is present.