Tests that we correctly calculate nested loops.