Flattening/unflattening tests for array-like types.