"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const assert = require("assert");
const Pin_1 = require("../Pin");
const Serial_1 = require("../Serial");
const debug_1 = require("../debug");
const system_1 = require("./util/system");
const serial0 = new Serial_1.default(system_1.system);
serial0.play();
false && (0, debug_1.watchUnitAndLog)(serial0);
serial0.push('a', 1);
assert.equal(serial0.peakInput('a'), 1);
serial0.addOutput('a', new Pin_1.Pin());
assert.equal(serial0.takeOutput('a'), 1);
assert.equal(serial0.takeOutput('a'), undefined);
assert.equal(serial0.takeInput('a'), undefined);
serial0.addOutput('b', new Pin_1.Pin());
serial0.push('a', 1);
assert.equal(serial0.peakInput('a'), 1);
assert.equal(serial0.peakOutput('a'), 1);
assert.equal(serial0.peakOutput('b'), undefined);
assert.equal(serial0.takeOutput('a'), 1);
assert.equal(serial0.takeOutput('b'), 1);
assert.equal(serial0.takeInput('a'), undefined);
serial0.push('a', 2);
assert.equal(serial0.peakInput('a'), 2);
assert.equal(serial0.peakOutput('a'), 2);
assert.equal(serial0.peakOutput('b'), undefined);
assert.equal(serial0.takeInput('a'), 2);
assert.equal(serial0.peakOutput('a'), undefined);
assert.equal(serial0.peakOutput('b'), undefined);
serial0.addOutput('c', new Pin_1.Pin());
serial0.push('a', 3);
assert.equal(serial0.peakInput('a'), 3);
assert.equal(serial0.peakOutput('a'), 3);
assert.equal(serial0.peakOutput('b'), undefined);
assert.equal(serial0.peakOutput('c'), undefined);
assert.equal(serial0.takeOutput('a'), 3);
assert.equal(serial0.takeOutput('b'), 3);
serial0.push('a', 4);
assert.equal(serial0.peakInput('a'), 4);
assert.equal(serial0.peakOutput('a'), 4);
assert.equal(serial0.peakOutput('b'), undefined);
assert.equal(serial0.peakOutput('c'), undefined);
assert.equal(serial0.takeOutput('a'), 4);
assert.equal(serial0.takeOutput('b'), 4);
assert.equal(serial0.takeOutput('c'), 4);
//# sourceMappingURL=Serial.js.map