rec2array and rec_stack unit tests