unit tests for folding