Add basic test coverage of toArrayBuffer function