"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const cloneUnit_1 = require("../../spec/cloneUnit");
const fromId_1 = require("../../spec/fromId");
const _classes_1 = require("../../system/_classes");
const _ids_1 = require("../../system/_ids");
const _specs_1 = require("../../system/_specs");
const Add_1 = require("../../system/f/arithmetic/Add");
const Identity_1 = require("../../system/f/control/Identity");
const assert_1 = require("../../util/assert");
const system_1 = require("../util/system");
const identity = new Identity_1.default(system_1.system);
identity.play();
identity.push('a', 0);
assert_1.assert.equal(identity.peakInput('a'), 0);
assert_1.assert.equal(identity.peakOutput('a'), 0);
const [clonedIdentity] = (0, cloneUnit_1.cloneUnit)(identity, true);
assert_1.assert.equal(clonedIdentity.peakInput('a'), 0);
assert_1.assert.equal(clonedIdentity.peakOutput('a'), 0);
clonedIdentity.play();
assert_1.assert.equal(clonedIdentity.peakInput('a'), 0);
assert_1.assert.equal(clonedIdentity.peakOutput('a'), 0);
clonedIdentity.push('a', 1);
assert_1.assert.equal(clonedIdentity.peakInput('a'), 1);
assert_1.assert.equal(clonedIdentity.peakOutput('a'), 1);
const add = new Add_1.default(system_1.system);
add.play();
add.setInputConstant('a', true);
add.push('a', 1);
const [clonedAdd] = (0, cloneUnit_1.cloneUnit)(add, true);
clonedAdd.play();
clonedAdd.push('b', 2);
assert_1.assert.equal(clonedAdd.getInput('a').constant(), true);
assert_1.assert.equal(clonedAdd.peakInput('a'), 1);
assert_1.assert.equal(clonedAdd.peakOutput('a + b'), 3);
const Range = (0, fromId_1.bundleFromId)(_ids_1.ID_RANGE, _specs_1.default, _classes_1.default);
const range = new Range(system_1.system);
range.play();
range.push('a', 0);
range.push('b', 3);
range.setOutputIgnored('test', true);
assert_1.assert.equal(range.peakInput('a'), 0);
assert_1.assert.equal(range.peakInput('b'), 3);
assert_1.assert.equal(range.peakOutput('i'), 0);
const [clonedRange] = (0, cloneUnit_1.cloneUnit)(range, true);
clonedRange.play();
assert_1.assert.equal(clonedRange.peakInput('a'), 0);
assert_1.assert.equal(clonedRange.peakInput('b'), 3);
assert_1.assert.equal(clonedRange.takeOutput('i'), 0);
assert_1.assert.equal(clonedRange.takeOutput('i'), 1);
assert_1.assert.equal(clonedRange.takeOutput('i'), 2);
assert_1.assert.equal(clonedRange.peakOutput('i'), undefined);
const [clonedRange0] = (0, cloneUnit_1.cloneUnit)(range, true);
clonedRange0.play();
assert_1.assert.equal(clonedRange0.takeInput('a'), 0);
assert_1.assert.equal(clonedRange0.takeOutput('i'), undefined);
//# sourceMappingURL=cloneUnit.js.map