#
#  PRE: foreach
#
#  Loop over children of a TLV.
#
#  Note that the only data types compatible with all data types are "string" or "octets"
#
string out

my-tlv := {
	a = 1,
	b = 2,
	c = "foo",
	d = 127.0.0.1,
}


out = ""

#
#  Home-brew concat!
#
foreach string child (my-tlv.[*]) {
	out += child
	out += " "
}

#
#  Sad trailing space, but we can delete it!
#
out -= ' '

if (out != '1 2 foo 127.0.0.1') {
	test_fail
}

success
