"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 NOOP_1 = require("../NOOP");
const watchUnit_1 = require("../debug/watchUnit");
const Identity_1 = __importDefault(require("../system/f/control/Identity"));
const system_1 = require("./util/system");
const identity = new Identity_1.default(system_1.system);
assert_1.default.equal(identity.listenerCount('err'), 0);
assert_1.default.equal(identity.listenerCount('destroy'), 1);
assert_1.default.equal(identity._input.a.listenerCount('data'), 0);
assert_1.default.equal(identity._output.a.listenerCount('data'), 0);
const unlisten = (0, watchUnit_1.watchUnit)(identity, NOOP_1.NOOP);
assert_1.default.equal(identity.listenerCount('err'), 2);
assert_1.default.equal(identity.listenerCount('destroy'), 3);
assert_1.default.equal(identity._input.a.listenerCount('data'), 1);
assert_1.default.equal(identity._output.a.listenerCount('data'), 1);
const unlisten0 = (0, watchUnit_1.watchUnit)(identity, NOOP_1.NOOP);
assert_1.default.equal(identity.listenerCount('err'), 4);
assert_1.default.equal(identity.listenerCount('destroy'), 5);
assert_1.default.equal(identity._input.a.listenerCount('data'), 2);
assert_1.default.equal(identity._output.a.listenerCount('data'), 2);
unlisten();
assert_1.default.equal(identity.listenerCount('err'), 2);
assert_1.default.equal(identity.listenerCount('destroy'), 3);
assert_1.default.equal(identity._input.a.listenerCount('data'), 1);
assert_1.default.equal(identity._output.a.listenerCount('data'), 1);
unlisten0();
assert_1.default.equal(identity.listenerCount('err'), 0);
assert_1.default.equal(identity.listenerCount('destroy'), 1);
assert_1.default.equal(identity._input.a.listenerCount('data'), 0);
assert_1.default.equal(identity._output.a.listenerCount('data'), 0);
const unlisten1 = (0, watchUnit_1.watchUnit)(identity, NOOP_1.NOOP);
assert_1.default.equal(identity.listenerCount('err'), 2);
assert_1.default.equal(identity.listenerCount('destroy'), 3);
assert_1.default.equal(identity._input.a.listenerCount('data'), 1);
assert_1.default.equal(identity._output.a.listenerCount('data'), 1);
identity.destroy();
assert_1.default.equal(identity.listenerCount('err'), 0);
assert_1.default.equal(identity.listenerCount('destroy'), 1);
assert_1.default.equal(identity._input.a.listenerCount('data'), 0);
assert_1.default.equal(identity._output.a.listenerCount('data'), 0);
//# sourceMappingURL=debug.js.map