Improved unit test for arrays