gm().toBuffer() tests