"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const assert = require("assert");
const NOOP_1 = require("../NOOP");
const watchUnit_1 = require("../debug/watchUnit");
const Identity_1 = require("../system/f/control/Identity");
const system_1 = require("./util/system");
const identity = new Identity_1.default(system_1.system);
assert.equal(identity.listenerCount('err'), 0);
assert.equal(identity.listenerCount('destroy'), 1);
assert.equal(identity._input.a.listenerCount('data'), 0);
assert.equal(identity._output.a.listenerCount('data'), 0);
const unlisten = (0, watchUnit_1.watchUnit)(identity, NOOP_1.NOOP);
assert.equal(identity.listenerCount('err'), 2);
assert.equal(identity.listenerCount('destroy'), 3);
assert.equal(identity._input.a.listenerCount('data'), 1);
assert.equal(identity._output.a.listenerCount('data'), 1);
const unlisten0 = (0, watchUnit_1.watchUnit)(identity, NOOP_1.NOOP);
assert.equal(identity.listenerCount('err'), 4);
assert.equal(identity.listenerCount('destroy'), 5);
assert.equal(identity._input.a.listenerCount('data'), 2);
assert.equal(identity._output.a.listenerCount('data'), 2);
unlisten();
assert.equal(identity.listenerCount('err'), 2);
assert.equal(identity.listenerCount('destroy'), 3);
assert.equal(identity._input.a.listenerCount('data'), 1);
assert.equal(identity._output.a.listenerCount('data'), 1);
unlisten0();
assert.equal(identity.listenerCount('err'), 0);
assert.equal(identity.listenerCount('destroy'), 1);
assert.equal(identity._input.a.listenerCount('data'), 0);
assert.equal(identity._output.a.listenerCount('data'), 0);
const unlisten1 = (0, watchUnit_1.watchUnit)(identity, NOOP_1.NOOP);
assert.equal(identity.listenerCount('err'), 2);
assert.equal(identity.listenerCount('destroy'), 3);
assert.equal(identity._input.a.listenerCount('data'), 1);
assert.equal(identity._output.a.listenerCount('data'), 1);
identity.destroy();
assert.equal(identity.listenerCount('err'), 0);
assert.equal(identity.listenerCount('destroy'), 1);
assert.equal(identity._input.a.listenerCount('data'), 0);
assert.equal(identity._output.a.listenerCount('data'), 0);
//# sourceMappingURL=debug.js.map