Added tests for repeat and foreach