#
# PRE: if concat
#
string result_string

control -= Password[*]

control += {
	User-Name = request.User-Name
	User-Password = request.User-Password
	Filter-Id = "ab c"
	Filter-Id = "de fg"
	NAS-Port = 123
}

request.Framed-IP-Address := 192.168.1.254

debug_control
debug_request

#
#  Don't insert this string into the request list, because we're getting its value
#  from all of the request attributes.  And the insertion of the new attribute happens before the
#  RHS value is created?  That seems wrong...
#
#  This is because edit_list_pair_build() is called before the value is created, when we're trying to
#  see if the attribute already exists.  In order to fix this, we have to create the value first, and
#  then modify the list.  Changing that involves fixing the logic in edit.c to check for ":=", and if
#  it is there, do a simple "find" first.
#
#  @todo - fix this...
#
result_string := %concat(%join(%{control.[*]}, %{request.Framed-IP-Address}), '. ')

if (!(result_string == "bob. hello. ab c. de fg. 123. 192.168.1.254")) {
	test_fail
}

result_string := %concat(%join(%{control.Filter-Id[*]}, %{control.NAS-Port}), ',')
if (!(result_string == "ab c,de fg,123")) {
	test_fail
}

success
