Test AFL query generation