"use strict";

var _vitest = require("vitest");
var _index = _interopRequireDefault(require("../../lib/stream/index"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
(0, _vitest.describe)('Buffered Stream Tests', function () {
  (0, _vitest.it)('endOfStream for empty stream', function () {
    (0, _vitest.expect)(_index["default"].buffered(_index["default"].ofString('')).endOfStream(0)).toBe(true);
  });
  (0, _vitest.it)('endOfStream for non empty stream', function () {
    (0, _vitest.expect)(_index["default"].buffered(_index["default"].ofString('1')).endOfStream(1)).toBe(true);
  });
  (0, _vitest.it)('no endOfStream for non empty stream', function () {
    (0, _vitest.expect)(_index["default"].buffered(_index["default"].ofString('1')).endOfStream(0)).toBe(false);
  });
  (0, _vitest.it)('get from stream', function () {
    (0, _vitest.expect)(_index["default"].buffered(_index["default"].ofString('1')).get(0).isSuccess()).toBe(true);
  });
  (0, _vitest.it)('do not get from empty stream', function () {
    (0, _vitest.expect)(_index["default"].buffered(_index["default"].ofString('1')).get(1).isSuccess()).toBe(false);
  });
  (0, _vitest.it)('get from stream number 1', function () {
    (0, _vitest.expect)(_index["default"].buffered(_index["default"].ofString('123')).get(0).success()).toBe('1');
  });
  (0, _vitest.it)('get from stream number is cached', function () {
    var s = _index["default"].buffered(_index["default"].ofString('123'));
    var v = s.get(0);
    (0, _vitest.expect)(s.get(0)).toBe(v);
  });
});
//# sourceMappingURL=buffered_stream_test.spec.js.map