add test for special case with a subshell in loop