#
#  PRE: update
#
update control {
	NAS-Port := 5
	NAS-Port += 10
	NAS-Port += 15
	NAS-Port += 20
	Filter-Id := 'foo'
	Filter-Id += 'baz'
	Filter-Id += 'boink'
}

# Reset the request list
request := control

#
#  @fixme - EDIT - all kinds of other things are broken, and no time currently to debug them.
#

#
#  Integer ==
#
update request {
	NAS-Port == 10
}

if (!(NAS-Port[0] == 10)) {
	test_fail
}

if (!(%{NAS-Port[#]} == 1)) {
	test_fail
}

if (!(%{Filter-Id[#]} == 3)) {
	test_fail
}

# Reset the request list
request := control

#
#  String ==
#
update request {
	Filter-Id == 'baz'
}

if (!(Filter-Id[0] == 'baz')) {
	test_fail
}

if (!(%{Filter-Id[#]} == 1)) {
	test_fail
}

# Reset the request list
request := control

#
#  Integer <
#
update request {
	NAS-Port < 10
}

if (!(NAS-Port[0] == 5)) {
	test_fail
}

if (!(%{NAS-Port[#]} == 1)) {
	test_fail
}

if (!(%{Filter-Id[#]} == 3)) {
	test_fail
}

# Reset the request list
request := control

#
#  Integer >
#
update request {
	NAS-Port > 10
}

if (!(NAS-Port[0] == 15)) {
	test_fail
}

if (!(NAS-Port[1] == 20)) {
	test_fail
}


if (!(%{NAS-Port[#]} == 2)) {
	test_fail
}

if (!(%{Filter-Id[#]} == 3)) {
	test_fail
}

# Reset the request list
request := control


#
#  Integer <=
#
update request {
	NAS-Port <= 10
}

if (!(NAS-Port[0] == 5)) {
	test_fail
}

if (!(NAS-Port[1] == 10)) {
	test_fail
}

if (!(%{NAS-Port[#]} == 2)) {
	test_fail
}

if (!(%{Filter-Id[#]} == 3)) {
	test_fail
}

# Reset the request list
request := control

#
#  Integer >=
#
update request {
	NAS-Port >= 10
}

if (!(NAS-Port[0] == 10)) {
	test_fail
}

if (!(NAS-Port[1] == 15)) {
	test_fail
}

if (!(NAS-Port[2] == 20)) {
	test_fail
}

if (!(%{NAS-Port[#]} == 3)) {
	test_fail
}

if (!(%{Filter-Id[#]} == 3)) {
	test_fail
}

# Reset the request list
request := control

#
#  Integer !=
#
update request {
	NAS-Port != 10
}

if (!(NAS-Port[0] == 5)) {
	test_fail
}

if (!(NAS-Port[1] == 15)) {
	test_fail
}

if (!(NAS-Port[2] == 20)) {
	test_fail
}

if (!(%{NAS-Port[#]} == 3)) {
	test_fail
}

if (!(%{Filter-Id[#]} == 3)) {
	test_fail
}

# Reset the request list
request := control

update request {
	Callback-Id := 'baz'
	Callback-Id += 'boink'
}

#
#  String (Intersection)
#
update request {
	Filter-Id == Callback-Id[0]
}

if (!(Filter-Id[0] == Callback-Id[0])) {
	test_fail
}

if (!(%{Filter-Id[#]} == 1)) {
	test_fail
}

update control {
	Auth-Type := ::Accept
}

success
