"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const debug_1 = require("../../../debug");
const fromBundle_1 = require("../../../spec/fromBundle");
const _specs_1 = __importDefault(require("../../../system/_specs"));
const system_1 = require("../../util/system");
const bundle = require('./PriorityHead.json');
const PriorityHead = (0, fromBundle_1.fromBundle)(bundle, _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_1.default.deepEqual(priorityHead.peakInput('a'), []);
assert_1.default.deepEqual(priorityHead.peakInput('b'), []);
assert_1.default.deepEqual(priorityHead.take('a'), []);
assert_1.default.deepEqual(priorityHead.take('b'), []);
assert_1.default.deepEqual(priorityHead.take('head'), Infinity);
assert_1.default.deepEqual(priorityHead.peakInput('a'), undefined);
assert_1.default.deepEqual(priorityHead.peakInput('b'), undefined);
priorityHead.push('a', [0]);
priorityHead.push('b', [1]);
assert_1.default.deepEqual(priorityHead.peakInput('a'), [0]);
assert_1.default.deepEqual(priorityHead.peakInput('b'), [1]);
assert_1.default.deepEqual(priorityHead.take('a'), []);
assert_1.default.deepEqual(priorityHead.take('b'), [1]);
assert_1.default.deepEqual(priorityHead.take('head'), 0);
assert_1.default.deepEqual(priorityHead.peakInput('a'), undefined);
assert_1.default.deepEqual(priorityHead.peakInput('b'), undefined);
priorityHead.push('a', [-1]);
priorityHead.push('b', [-2]);
assert_1.default.deepEqual(priorityHead.peakInput('a'), [-1]);
assert_1.default.deepEqual(priorityHead.peakInput('b'), [-2]);
assert_1.default.deepEqual(priorityHead.take('a'), [-1]);
assert_1.default.deepEqual(priorityHead.take('b'), []);
assert_1.default.deepEqual(priorityHead.take('head'), -2);
assert_1.default.deepEqual(priorityHead.peakInput('a'), undefined);
assert_1.default.deepEqual(priorityHead.peakInput('b'), undefined);
priorityHead.push('a', [-1]);
priorityHead.push('b', [-3, -2]);
assert_1.default.deepEqual(priorityHead.peakInput('a'), [-1]);
assert_1.default.deepEqual(priorityHead.peakInput('b'), [-3, -2]);
assert_1.default.deepEqual(priorityHead.take('a'), [-1]);
assert_1.default.deepEqual(priorityHead.take('b'), [-2]);
assert_1.default.deepEqual(priorityHead.take('head'), -3);
assert_1.default.deepEqual(priorityHead.peakInput('a'), undefined);
assert_1.default.deepEqual(priorityHead.peakInput('b'), undefined);
//# sourceMappingURL=PriorityHead.js.map