add test function for  loop input