Add tests for main functions