add clos encode test