"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const assert = require("assert");
const Graph_1 = require("../../Class/Graph");
const debug_1 = require("../../debug");
const _ids_1 = require("../../system/_ids");
const system_1 = require("../util/system");
const UNIT_ID_EMTPY = 'empty';
const UNIT_ID_IDENTITY = 'identity';
const UNIT_ID_IDENTITY_0 = 'identity0';
const spec = system_1.system.newSpec({});
const composition0 = new Graph_1.Graph(spec, {}, system_1.system);
false && (0, debug_1.watchUnitAndLog)(composition0);
false && (0, debug_1.watchGraphAndLog)(composition0);
composition0.play();
composition0.addUnitSpec(UNIT_ID_EMTPY, {
    unit: { id: _ids_1.ID_EMPTY },
});
composition0.addUnitSpec(UNIT_ID_IDENTITY, {
    unit: { id: _ids_1.ID_IDENTITY },
});
composition0.addUnitSpec(UNIT_ID_IDENTITY_0, {
    unit: { id: _ids_1.ID_IDENTITY },
});
const empty = composition0.refUnit(UNIT_ID_EMTPY);
const identity = composition0.refUnit(UNIT_ID_IDENTITY);
const identity0 = composition0.refUnit(UNIT_ID_IDENTITY_0);
assert.equal(composition0.getUnitCount(), 3);
composition0.addMerge({
    [UNIT_ID_IDENTITY]: {
        output: {
            a: true,
        },
    },
    [UNIT_ID_IDENTITY_0]: {
        input: {
            a: true,
        },
    },
}, '0');
composition0.moveMergeInto(UNIT_ID_EMTPY, '0', { mergeId: '0', pinId: 'a', subPinSpec: {} }, { mergeId: '1', pinId: 'a', subPinSpec: {} });
assert.equal(composition0.getUnitCount(), 3);
assert.equal(composition0.getMergeCount(), 2);
assert.equal(empty.getInputCount(), 1);
assert.equal(empty.getOutputCount(), 1);
assert(empty.hasInputNamed('a'));
assert(empty.hasOutputNamed('a'));
assert.deepEqual(empty.getExposedInputSpec('a'), {
    plug: {
        '0': {},
    },
    ref: false,
});
//# sourceMappingURL=moveMergeInto.js.map