"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const assert = require("assert");
const debug_1 = require("../../../debug");
const fromSpec_1 = require("../../../spec/fromSpec");
const _specs_1 = require("../../../system/_specs");
const system_1 = require("../../util/system");
const spec = require('../../../system/core/common/PriorityHead/spec.json');
const PriorityHead = (0, fromSpec_1.fromSpec)(spec, _specs_1.default);
const priorityHead = new PriorityHead(system_1.system);
false && (0, debug_1.watchUnitAndLog)(priorityHead);
false && (0, debug_1.watchGraphAndLog)(priorityHead);
priorityHead.play();
priorityHead.push('a', []);
priorityHead.push('b', []);
assert.deepEqual(priorityHead.peakInput('a'), []);
assert.deepEqual(priorityHead.peakInput('b'), []);
assert.deepEqual(priorityHead.take('a'), []);
assert.deepEqual(priorityHead.take('b'), []);
assert.deepEqual(priorityHead.take('head'), Infinity);
assert.deepEqual(priorityHead.peakInput('a'), undefined);
assert.deepEqual(priorityHead.peakInput('b'), undefined);
priorityHead.push('a', [0]);
priorityHead.push('b', [1]);
assert.deepEqual(priorityHead.peakInput('a'), [0]);
assert.deepEqual(priorityHead.peakInput('b'), [1]);
assert.deepEqual(priorityHead.take('a'), []);
assert.deepEqual(priorityHead.take('b'), [1]);
assert.deepEqual(priorityHead.take('head'), 0);
assert.deepEqual(priorityHead.peakInput('a'), undefined);
assert.deepEqual(priorityHead.peakInput('b'), undefined);
priorityHead.push('a', [-1]);
priorityHead.push('b', [-2]);
assert.deepEqual(priorityHead.peakInput('a'), [-1]);
assert.deepEqual(priorityHead.peakInput('b'), [-2]);
assert.deepEqual(priorityHead.take('a'), [-1]);
assert.deepEqual(priorityHead.take('b'), []);
assert.deepEqual(priorityHead.take('head'), -2);
assert.deepEqual(priorityHead.peakInput('a'), undefined);
assert.deepEqual(priorityHead.peakInput('b'), undefined);
priorityHead.push('a', [-1]);
priorityHead.push('b', [-3, -2]);
assert.deepEqual(priorityHead.peakInput('a'), [-1]);
assert.deepEqual(priorityHead.peakInput('b'), [-3, -2]);
assert.deepEqual(priorityHead.take('a'), [-1]);
assert.deepEqual(priorityHead.take('b'), [-2]);
assert.deepEqual(priorityHead.take('head'), -3);
assert.deepEqual(priorityHead.peakInput('a'), undefined);
assert.deepEqual(priorityHead.peakInput('b'), undefined);
//# sourceMappingURL=PriorityHead.js.map