test(benchmarks): add C#/ASP.NET and TypeScript tasks
Six tasks with hidden checks: ASP.NET validation and 404 handling, C# cancellation, and TypeScript overlap, deep merge, and debounce fixes, checked with dotnet run and node --test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
97879fd6a5
commit
f43a2df14b
30 files changed
+349
-2
No files matched your search
@@ -0,0 +1,14 @@
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { overlaps } from '../src/booking.ts';
|
||||
|
||||
test('back-to-back bookings do not overlap', () => {
|
||||
assert.equal(overlaps({ start: 9, end: 10 }, { start: 10, end: 11 }), false);
|
||||
assert.equal(overlaps({ start: 10, end: 11 }, { start: 9, end: 10 }), false);
|
||||
});
|
||||
|
||||
test('real overlaps are detected', () => {
|
||||
assert.equal(overlaps({ start: 9, end: 11 }, { start: 10, end: 12 }), true);
|
||||
assert.equal(overlaps({ start: 9, end: 12 }, { start: 10, end: 11 }), true);
|
||||
assert.equal(overlaps({ start: 9, end: 10 }, { start: 11, end: 12 }), false);
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "booking",
|
||||
"type": "module",
|
||||
"private": true
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export interface Booking {
|
||||
start: number;
|
||||
end: number;
|
||||
}
|
||||
|
||||
export function overlaps(a: Booking, b: Booking): boolean {
|
||||
return a.start <= b.end && b.start <= a.end;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"prompt": "Back-to-back bookings, where one ends exactly when the next starts, are wrongly reported as overlapping. Fix overlaps() without breaking real overlaps.",
|
||||
"check": [
|
||||
"node",
|
||||
"--experimental-strip-types",
|
||||
"--no-warnings",
|
||||
"--test",
|
||||
"bench_hidden/check.test.ts"
|
||||
],
|
||||
"workflow": {
|
||||
"kind": "TypeScript change"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user