Set the decision and its input
The fictional deadline is minute60, measured from the supplied origin. The run starts59 and finishes64. “Starts by60” passes; “output finished by60” fails. This buying requirement needs the latter, so an early start cannot establish fit.
| Case | Input JSON |
|---|---|
| Base test | {"start":59,"finish":64,"deadline":60} |
Run the supplied comparison
The local programme evaluates both observed events and keeps their meanings separate. These are supplied synthetic timings, not a measured vendor response guarantee.
| Path | Output JSON |
|---|---|
| Faulty path | {"startFits":true,"finishFits":false,"requirementSatisfied":true} |
| Required path | {"startFits":true,"finishFits":false,"requirementSatisfied":false} |
import assert from 'node:assert/strict';
const run=function run(i,corrected=true){
if(i.start===null||i.finish===null||i.deadline===null)return {held:true};
const startFits=i.start<=i.deadline,finishFits=i.finish<=i.deadline;
return {startFits,finishFits,requirementSatisfied:corrected?finishFits:startFits};
};
const cases=[{"input":{"start":59,"finish":64,"deadline":60},"corrected":false,"expected":{"startFits":true,"finishFits":false,"requirementSatisfied":true}},{"input":{"start":59,"finish":64,"deadline":60},"corrected":true,"expected":{"startFits":true,"finishFits":false,"requirementSatisfied":false}},{"input":{"start":59,"finish":60,"deadline":60},"corrected":true,"expected":{"startFits":true,"finishFits":true,"requirementSatisfied":true}},{"input":{"start":59,"finish":null,"deadline":60},"corrected":true,"expected":{"held":true}}];
for(const test of cases){const actual=await run(test.input,test.corrected);assert.deepEqual(actual,test.expected);console.log(actual);}
Choose from the boundary evidence
Finishing exactly60 passes the inclusive requirement. Missing completion observation is held rather than inferred from start.
- Name the deadline event
- Compare its observed time
- Retain other timing separately
A missing finish time remains unknown.
| Condition | Input JSON | Expected output JSON |
|---|---|---|
| completion at the deadline | {"start":59,"finish":60,"deadline":60} | {"startFits":true,"finishFits":true,"requirementSatisfied":true} |
| finish observation absent | {"start":59,"finish":null,"deadline":60} | {"held":true} |
Can the base run meet the required completion deadline?
Show the worked answer
No. Start59 fits but finish64 exceeds60. Record the required completion event, not just the easier start claim.