import assert from 'node:assert/strict'; import test from 'node:test'; import { findPinnedGap } from '../lib/pinnedGeometry.ts'; test('примыкающие закреплённые колонки: -1', () => { assert.equal(findPinnedGap([{ left: 0, width: 40 }, { left: 40, width: 120 }, { left: 160, width: 300 }]), -1); }); test('наложение после смены ширины: индекс левой колонки пары', () => { assert.equal(findPinnedGap([{ left: 0, width: 40 }, { left: 40, width: 200 }, { left: 160, width: 300 }]), 1); }); test('зазор: индекс левой колонки пары', () => { assert.equal(findPinnedGap([{ left: 0, width: 40 }, { left: 60, width: 120 }]), 0); }); test('дробные пиксели в пределах допуска 1 px: -1', () => { assert.equal(findPinnedGap([{ left: 0, width: 40.4 }, { left: 41.2, width: 10 }]), -1); }); test('меньше двух колонок: -1', () => { assert.equal(findPinnedGap([]), -1); assert.equal(findPinnedGap([{ left: 0, width: 40 }]), -1); });