Datasets:
Download code/evaluation-code/ent400-a06a1576/apps/console/web/tests/layout.test.ts from VEHwang/cocogni4d: direct link, hf CLI and curl.
- Browser
- Download file 627 Bytes
-
https://huggingface.co/datasets/VEHwang/cocogni4d/resolve/main/code/evaluation-code/ent400-a06a1576/apps/console/web/tests/layout.test.ts
- Command line
-
hf download hf://datasets/VEHwang/cocogni4d/code/evaluation-code/ent400-a06a1576/apps/console/web/tests/layout.test.ts
-
curl -L -o layout.test.ts https://huggingface.co/datasets/VEHwang/cocogni4d/resolve/main/code/evaluation-code/ent400-a06a1576/apps/console/web/tests/layout.test.ts
627 Bytes
| import test from 'node:test'; | |
| import assert from 'node:assert/strict'; | |
| import {intersects, pointInside} from '../src/layout.ts'; | |
| test('label rectangle overlap rejects touching interiors and permits separated text', () => { | |
| const first = {left: 0, top: 0, right: 20, bottom: 10}; | |
| assert.equal(intersects(first, {left: 21, top: 0, right: 40, bottom: 10}), false); | |
| assert.equal(intersects(first, {left: 10, top: 0, right: 30, bottom: 10}), true); | |
| const room: [number, number][] = [[0, 0], [10, 0], [10, 10], [0, 10]]; | |
| assert.equal(pointInside([5, 5], room), true); | |
| assert.equal(pointInside([15, 5], room), false); | |
| }); | |