#
#  PRE: if return foreach
#
control += {
	NAS-Port = 0
	NAS-Port = 1
	NAS-Port = 2
	NAS-Port = 3
}

foreach control.NAS-Port {
	policy_return

	# Should continue executing
	if ("%{Foreach-Variable-0}" == '2') {
		break
	}

	control -= {
		NAS-Port == "%{Foreach-Variable-0}"
	}
}

# Everything should have been removed except
# the last incidence of NAS-Port
if (!control.NAS-Port) {
	test_fail
}
if (!(control.NAS-Port[0] == 2)) {
	test_fail
}

success
