"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 Identity_1 = __importDefault(require("../../../../system/f/control/Identity"));
const system_1 = require("../../../util/system");
const identity = new Identity_1.default(system_1.system);
identity.play();
false && (0, debug_1.watchUnitAndLog)(identity);
identity.push('a', 1);
assert_1.default.equal(identity.takeOutput('a'), 1);
identity.push('a', 1);
assert_1.default.equal(identity.takeOutput('a'), 1);
identity.push('a', null);
assert_1.default.equal(identity.takeOutput('a'), null);
identity.setInputConstant('a', true);
(0, assert_1.default)(identity.getInput('a').constant());
identity.push('a', 4);
assert_1.default.equal(identity.peakInput('a'), 4);
assert_1.default.equal(identity.peakOutput('a'), 4);
assert_1.default.equal(identity.takeOutput('a'), 4);
assert_1.default.equal(identity.takeOutput('a'), 4);
assert_1.default.equal(identity.takeOutput('a'), 4);
const snap = identity.snapshot();
assert_1.default.deepEqual(snap, {
    input: {
        a: {
            _register: 4,
            _constant: true,
            _idle: false,
        },
    },
    output: {
        a: {
            _register: 4,
            _idle: false,
        },
    },
    memory: {
        _looping: true,
    },
});
const another_identity = new Identity_1.default(system_1.system);
another_identity.restore(snap);
assert_1.default.deepEqual(another_identity.snapshot(), {
    input: {
        a: {
            _register: 4,
            _constant: true,
            _idle: false,
        },
    },
    output: {
        a: {
            _register: 4,
            _idle: false,
        },
    },
    memory: {
        _looping: true,
    },
});
//# sourceMappingURL=Identity.js.map