add loop pattern test