Add tests for the fold detector