#test of int maps containing ints

global foo

probe begin {
	for (i=0;i<11;i++)
		foo[i] = i*i 	

	foreach (i in foo)
	 	printf("foo[%d] = %d\n", i, foo[i])

	# delete out of the index
	delete foo[11]
	printf("\n")
	foreach (i in foo)
	 	printf("foo[%d] = %d\n", i, foo[i])

	# delete out of the middle
	delete foo[5]
	printf("\n")
	foreach (i in foo)
	 	printf("foo[%d] = %d\n", i, foo[i])

	# delete first entry
	delete foo[1]
	# and last entry
	delete foo[10]
	printf("\n")
	foreach (i in foo)
	 	printf("foo[%d] = %d\n", i, foo[i])

	# change a couple
	foo[9] = -81
	foo[4] = -foo[4]
	foo[3] *= 100
	printf("\n")
	foreach (i in foo)
	 	printf("foo[%d] = %d\n", i, foo[i])

	# delete one
	delete foo[4]
	printf("\n")
	foreach (i in foo)
	 	printf("foo[%d] = %d\n", i, foo[i])

	# delete all
	for (i=0;i<11;i++)
		delete foo[i]
	printf("\n")
	foreach (i in foo)
	 	printf("foo[%d] = %d\n", i, foo[i])

	# load it again
	for (i=0;i<11;i++)
		foo[i] = i*i 	
	for (i=0;i<11;i++)
		foo[i] += foo[i-1]
	printf("\n")
	foreach (i in foo)
	 	printf("foo[%d] = %d\n", i, foo[i])

	exit()
}

