Unit tests for map and reduce functions.