"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");
// import NArrayBuilder from '../../../system/core/common/NArrayBuilder/Class'
const system_1 = require("../../util/system");
const spec = require('../../../system/core/common/NArrayBuilder/spec.json');
const NArrayBuilder = (0, fromSpec_1.fromSpec)(spec, _specs_1.default);
const nArrayBuilder = new NArrayBuilder(system_1.system);
false && (0, debug_1.watchGraphAndLog)(nArrayBuilder);
false && (0, debug_1.watchUnitAndLog)(nArrayBuilder);
false && (0, debug_1.watchGraphAndLog)(nArrayBuilder.getUnit('buildarrayfrom'));
nArrayBuilder.play();
nArrayBuilder.push('n', 0);
nArrayBuilder.setOutputIgnored('test', true);
nArrayBuilder.setOutputIgnored('acc', true);
assert.deepEqual(nArrayBuilder.take('a[]'), []);
assert.equal(nArrayBuilder.take('a[]'), undefined);
assert.equal(nArrayBuilder.peakInput('n'), undefined);
nArrayBuilder.push('n', 1);
assert.equal(nArrayBuilder.peakInput('n'), 1);
assert.equal(nArrayBuilder.take('a[]'), undefined);
nArrayBuilder.push('a', 0);
assert.deepEqual(nArrayBuilder.take('a[]'), [0]);
assert.deepEqual(nArrayBuilder.take('a[]'), undefined);
nArrayBuilder.push('a', 0);
nArrayBuilder.push('n', 2);
nArrayBuilder.push('a', 1);
assert.deepEqual(nArrayBuilder.take('a[]'), [0, 1]);
assert.equal(nArrayBuilder.takeInput('a'), undefined);
assert.equal(nArrayBuilder.takeInput('n'), undefined);
nArrayBuilder.push('n', 3);
nArrayBuilder.push('a', 10);
nArrayBuilder.push('a', 11);
nArrayBuilder.push('a', 12);
assert.deepEqual(nArrayBuilder.take('a[]'), [10, 11, 12]);
assert.deepEqual(nArrayBuilder.take('a[]'), undefined);
assert.equal(nArrayBuilder.takeInput('n'), undefined);
assert.equal(nArrayBuilder.takeInput('a'), undefined);
nArrayBuilder.push('n', 3);
nArrayBuilder.push('a', 13);
nArrayBuilder.push('a', 14);
nArrayBuilder.push('a', 15);
nArrayBuilder.push('n', 2);
nArrayBuilder.push('a', 16);
nArrayBuilder.push('a', 17);
assert.deepEqual(nArrayBuilder.take('a[]'), [16, 17]);
assert.deepEqual(nArrayBuilder.take('a[]'), undefined);
assert.equal(nArrayBuilder.takeInput('n'), undefined);
assert.equal(nArrayBuilder.takeInput('a'), undefined);
nArrayBuilder.push('n', 1);
nArrayBuilder.push('a', 18);
assert.deepEqual(nArrayBuilder.take('a[]'), [18]);
assert.deepEqual(nArrayBuilder.take('a[]'), undefined);
nArrayBuilder.push('n', 1);
nArrayBuilder.push('a', 19);
nArrayBuilder.push('n', 0);
assert.deepEqual(nArrayBuilder.take('a[]'), []);
assert.deepEqual(nArrayBuilder.take('a[]'), undefined);
nArrayBuilder.push('n', 3);
nArrayBuilder.push('a', 20);
nArrayBuilder.push('a', 21);
nArrayBuilder.push('a', 22);
nArrayBuilder.push('a', 23);
assert.deepEqual(nArrayBuilder.take('a[]'), [20, 21, 22]);
nArrayBuilder.push('n', 1);
assert.deepEqual(nArrayBuilder.take('a[]'), [23]);
assert.deepEqual(nArrayBuilder.take('a[]'), undefined);
nArrayBuilder.push('n', 1);
assert.deepEqual(nArrayBuilder.takeInput('n'), 1);
assert.deepEqual(nArrayBuilder.peakInput('n'), undefined);
nArrayBuilder.push('a', 1);
assert.deepEqual(nArrayBuilder.peakInput('a'), 1);
assert.deepEqual(nArrayBuilder.peak('a[]'), undefined);
nArrayBuilder.push('n', 1);
assert.deepEqual(nArrayBuilder.take('a[]'), [1]);
assert.deepEqual(nArrayBuilder.peakInput('a'), undefined);
assert.deepEqual(nArrayBuilder.peakInput('n'), undefined);
nArrayBuilder.setInputConstant('a', true);
nArrayBuilder.push('a', 0);
nArrayBuilder.push('n', 2);
assert.deepEqual(nArrayBuilder.peakOutput('a[]'), [0, 0]);
nArrayBuilder.push('n', 1);
assert.deepEqual(nArrayBuilder.takeOutput('a[]'), [0]);
nArrayBuilder.setInputConstant('a', false);
assert.deepEqual(nArrayBuilder.takeInput('a'), 0);
assert.deepEqual(nArrayBuilder.peakInput('a'), undefined);
assert.deepEqual(nArrayBuilder.takeInput('n'), undefined);
nArrayBuilder.setInputConstant('a', true);
nArrayBuilder.push('a', 0);
nArrayBuilder.push('n', 6);
assert.deepEqual(nArrayBuilder.take('a[]'), [0, 0, 0, 0, 0, 0]);
assert.deepEqual(nArrayBuilder.take('a[]'), undefined);
nArrayBuilder.push('n', 3);
assert.deepEqual(nArrayBuilder.take('a[]'), [0, 0, 0]);
assert.deepEqual(nArrayBuilder.take('a[]'), undefined);
nArrayBuilder.push('n', 3);
assert.deepEqual(nArrayBuilder.take('a[]'), [0, 0, 0]);
nArrayBuilder.push('n', 4);
assert.deepEqual(nArrayBuilder.take('a[]'), [0, 0, 0, 0]);
nArrayBuilder.push('n', 2);
assert.deepEqual(nArrayBuilder.peakOutput('a[]'), [0, 0]);
nArrayBuilder.push('n', 2);
assert.deepEqual(nArrayBuilder.peakOutput('a[]'), [0, 0]);
nArrayBuilder.push('n', 1);
assert.deepEqual(nArrayBuilder.peakOutput('a[]'), [0]);
nArrayBuilder.push('n', 3);
assert.deepEqual(nArrayBuilder.takeOutput('a[]'), [0, 0, 0]);
nArrayBuilder.setInputConstant('a', false);
assert.deepEqual(nArrayBuilder.takeInput('a'), 0);
assert.deepEqual(nArrayBuilder.peakInput('a'), undefined);
assert.deepEqual(nArrayBuilder.takeInput('n'), undefined);
nArrayBuilder.setInputConstant('a', true);
nArrayBuilder.setInputConstant('n', true);
nArrayBuilder.push('n', 0);
assert.equal(nArrayBuilder.peakInput('n'), 0);
assert.deepEqual(nArrayBuilder.take('a[]'), []);
assert.deepEqual(nArrayBuilder.take('a[]'), []);
assert.deepEqual(nArrayBuilder.take('a[]'), []);
assert.deepEqual(nArrayBuilder.take('a[]'), []);
assert.deepEqual(nArrayBuilder.take('a[]'), []);
assert.deepEqual(nArrayBuilder.take('a[]'), []);
nArrayBuilder.setInputConstant('a', false);
nArrayBuilder.setInputConstant('n', false);
assert.deepEqual(nArrayBuilder.takeInput('n'), 0);
assert.deepEqual(nArrayBuilder.takeInput('n'), undefined);
nArrayBuilder.setInputConstant('a', true);
nArrayBuilder.setInputConstant('n', true);
nArrayBuilder.push('a', 1);
nArrayBuilder.push('n', 1);
assert.equal(nArrayBuilder.peakInput('n'), 1);
assert.equal(nArrayBuilder.peakInput('a'), 1);
assert.deepEqual(nArrayBuilder.take('a[]'), [1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1]);
nArrayBuilder.setInputConstant('a', false);
nArrayBuilder.setInputConstant('n', false);
assert.deepEqual(nArrayBuilder.take('a[]'), [1]);
nArrayBuilder.setInputConstant('a', true);
nArrayBuilder.setInputConstant('n', true);
nArrayBuilder.push('a', 2);
nArrayBuilder.push('n', 2);
assert.deepEqual(nArrayBuilder.take('a[]'), [2, 2]);
assert.deepEqual(nArrayBuilder.take('a[]'), [2, 2]);
assert.deepEqual(nArrayBuilder.take('a[]'), [2, 2]);
assert.deepEqual(nArrayBuilder.take('a[]'), [2, 2]);
assert.deepEqual(nArrayBuilder.take('a[]'), [2, 2]);
assert.deepEqual(nArrayBuilder.take('a[]'), [2, 2]);
assert.deepEqual(nArrayBuilder.take('a[]'), [2, 2]);
nArrayBuilder.setInputConstant('a', false);
nArrayBuilder.setInputConstant('n', false);
assert.deepEqual(nArrayBuilder.take('a[]'), [2, 2]);
nArrayBuilder.setInputConstant('a', true);
nArrayBuilder.setInputConstant('n', true);
nArrayBuilder.push('a', 1);
nArrayBuilder.push('n', 3);
assert.deepEqual(nArrayBuilder.take('a[]'), [1, 1, 1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1, 1, 1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1, 1, 1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1, 1, 1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1, 1, 1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1, 1, 1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1, 1, 1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1, 1, 1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1, 1, 1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1, 1, 1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1, 1, 1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1, 1, 1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1, 1, 1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1, 1, 1]);
assert.deepEqual(nArrayBuilder.take('a[]'), [1, 1, 1]);
// arrayBuilder.reset()
// assert.deepEqual(arrayBuilder.take('a[]'), [1, 1, 1])
//# sourceMappingURL=NArrayBuilder.js.map