add complex encode test