"""Replan during takeoff without prematurely demanding cruise clearance.""" from pathlib import Path import subprocess, tempfile root = Path(__file__).resolve().parents[2] code = r''' #include "ClientlessFlightPath.h" #include using namespace ClientlessFlightPath; int main(){Settings c;Memory m;auto sample=[](float,float){return Surface{94.314f,550,true};};auto ray=[](Point const&,Point const&){return true;};Point goal{-8186,419,94.314f};auto n=Next({-8829,624,94.314f},goal,c,m,sample,ray);assert(n.Valid&&!m.Departed);n=Next({-8826.7f,622.306f,96.4122f},goal,c,m,sample,ray);assert(n.Valid&&!m.Departed);n=Next({-8800,610,104},goal,c,m,sample,ray);assert(n.Valid&&m.Departed);} ''' with tempfile.TemporaryDirectory(prefix="vcore-takeoff-handoff-") as directory: path = Path(directory) (path / "test.cpp").write_text(code) subprocess.run(["c++", "-std=c++17", "-I" + str(root / "src/server/game/World"), str(path / "test.cpp"), "-o", str(path / "test")], check=True) subprocess.run([str(path / "test")], check=True) print("Takeoff handoff at two yards and promotion at real cruise clearance PASS")