<?php
declare(strict_types=1);require __DIR__.'/decimal-oracle.php';$n=0;foreach(['1'=>'1.00','1.0'=>'1.00','1.00'=>'1.00','0'=>'0.00','0.0'=>'0.00','-0.00'=>'0.00','0.01'=>'0.01','99999999.99'=>'99999999.99'] as $raw=>$expected){if(dec102text((string)$raw)!==$expected)throw new RuntimeException('Positive oracle');$n++;}foreach([1,1.0,true,null,[],new stdClass(),'1.000','1e0','NaN','INF','1.01x','100000000.00',' 1.00','1.00 ','0.001','+1.00'] as $bad){try{dec102text($bad);throw new LogicException('Oracle accepted corruption');}catch(RuntimeException $e){$n++;}}foreach([true,null,[],new stdClass(),INF,NAN] as $bad){if(nativeDec102Type($bad))throw new RuntimeException('Native type corruption');$n++;}foreach(['1.01','0.99','-1.00'] as $bad){if(dec102text($bad)==='1.00')throw new RuntimeException('Value corruption');$n++;}echo json_encode(['checks'=>$n,'value_type_counterexamples'=>25,'SQL'=>0,'HTTP'=>0]),"\n";
