import { Assert, UnitTest } from '@ephox/bedrock-client';
import * as Overflows from 'ephox/alloy/toolbar/Overflows';
UnitTest.test('OverflowTest', () => {
    const len = (unit) => unit.length;
    const check = (expectedWithin, expectedExtra, total, input, overflower) => {
        const actual = Overflows.partition(total, input, len, overflower);
        Assert.eq('', expectedWithin, actual.within);
        Assert.eq('', expectedExtra, actual.extra);
    };
    check(['cat'], [], 100, ['cat'], 'overflow');
    check(['overflowing'], ['apple', 'bear', 'caterpillar', 'dingo'], 15, ['apple', 'bear', 'caterpillar', 'dingo'], 'overflowing');
    check(['ap', 'overflowing'], ['apple', 'bear', 'caterpillar', 'dingo'], 15, ['ap', 'apple', 'bear', 'caterpillar', 'dingo'], 'overflowing');
});
//# sourceMappingURL=OverflowTest.js.map