"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/array/RangeArray/spec.json');
const RangeArray = (0, fromSpec_1.fromSpec)(spec, _specs_1.default, {});
const rangeArray = new RangeArray(system_1.system);
false && (0, debug_1.watchUnitAndLog)(rangeArray);
false && (0, debug_1.watchGraphAndLog)(rangeArray);
rangeArray.play();
rangeArray.push('n', 0);
assert.deepEqual(rangeArray.take('a'), []);
assert.deepEqual(rangeArray.take('a'), undefined);
assert.deepEqual(rangeArray.peakInput('n'), undefined);
rangeArray.push('n', 1);
assert.deepEqual(rangeArray.take('a'), [0]);
assert.deepEqual(rangeArray.take('a'), undefined);
assert.deepEqual(rangeArray.peakInput('n'), undefined);
rangeArray.push('n', 6);
assert.deepEqual(rangeArray.take('a'), [0, 1, 2, 3, 4, 5]);
assert.deepEqual(rangeArray.take('a'), undefined);
assert.deepEqual(rangeArray.peakInput('n'), undefined);
rangeArray.push('n', 3);
assert.deepEqual(rangeArray.peak('a'), [0, 1, 2]);
rangeArray.push('n', 2);
assert.deepEqual(rangeArray.peak('a'), [0, 1]);
rangeArray.push('n', 1);
assert.deepEqual(rangeArray.take('a'), [0]);
assert.deepEqual(rangeArray.take('a'), undefined);
assert.deepEqual(rangeArray.peakInput('n'), undefined);
rangeArray.setInputConstant('n', true);
rangeArray.push('n', 3);
assert.deepEqual(rangeArray.take('a'), [0, 1, 2]);
assert.deepEqual(rangeArray.take('a'), [0, 1, 2]);
assert.deepEqual(rangeArray.take('a'), [0, 1, 2]);
assert.deepEqual(rangeArray.take('a'), [0, 1, 2]);
assert.deepEqual(rangeArray.take('a'), [0, 1, 2]);
assert.deepEqual(rangeArray.take('a'), [0, 1, 2]);
rangeArray.setInputConstant('n', true);
rangeArray.push('n', 4);
assert.deepEqual(rangeArray.take('a'), [0, 1, 2, 3]);
assert.deepEqual(rangeArray.take('a'), [0, 1, 2, 3]);
// assert.deepEqual(rangeArray.take('a'), [0, 1, 2, 3])
//# sourceMappingURL=RangeArray.js.map