added test function to check if slices are equal