
const fs=require("fs"),vm=require("vm");
const ctx={console,window:{}};ctx.window=ctx;vm.createContext(ctx);
vm.runInContext(fs.readFileSync(__dirname+"/data.js","utf8"),ctx);
vm.runInContext(fs.readFileSync(__dirname+"/tournaments.js","utf8"),ctx);
const u=ctx.FOOTBALL_TOURNAMENTS.find(x=>x.id==="ucl");
const direct=["11","405","13","16","131","27","2282","1047","234","141","46","23826","826","1082","31","281","985","6195","583","720","383","150","418","12","660","62","336","79","1050"];
if(u.teams.length!==36)throw Error("UCL="+u.teams.length);
if(new Set(u.teams).size!==36)throw Error("doublons UCL");
for(const id of direct)if(!u.teams.includes(id))throw Error("qualifié direct UEFA absent: "+id);
if(!u.teams.includes("131"))throw Error("FC Barcelona absent");
console.log("UCL 36/36; 29 qualifiés directs UEFA présents; FC Barcelona présent.");
