Sri Lanka became the first Asian side to win a Test series in South Africa, while Afghanistan posted the highest team total in the history of T20Is.