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