tests: improved toArray() test