<?php
declare(strict_types=1);
require_once __DIR__.'/../shared/lib/project_grading.php';
foreach([[0,'D'],[49.99,'D'],[50,'B'],[59.99,'B'],[60,'B+'],[69.99,'B+'],[70,'A'],[79.99,'A'],[80,'A+'],[100,'A+']] as [$score,$letter]){if(student_project_band((float)$score)['letter']!==$letter)throw new RuntimeException('Wrong boundary: '.$score);if(student_project_score((string)$score)!==(float)$score)throw new RuntimeException('Score parsing');}
foreach([-1,100.01,'NaN','INF','',null,true,[],'70.001','60abc'] as $bad){$rejected=false;try{student_project_score($bad);}catch(InvalidArgumentException){$rejected=true;}if(!$rejected)throw new RuntimeException('Invalid mark accepted');}
echo "PASS: all grading boundaries, decimal precision and invalid marks.\n";
