Add tests for loopSubProcess