Wanindu Hasaranga, the Sri Lankan leg-spinning all-rounder, has announced his retirement from Test cricket in order to prolong his limited-overs career.