foreach: Added tests.