Closurequery testing with advanced compilation