"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)('Stream Tests', function () {
  (0, _vitest.it)('endOfStream for empty stream', function () {
    (0, _vitest.expect)(_index["default"].ofString('').endOfStream(0)).toBe(true);
  });
  (0, _vitest.it)('endOfStream for non empty stream', function () {
    (0, _vitest.expect)(_index["default"].ofString('1').endOfStream(1)).toBe(true);
  });
  (0, _vitest.it)('no endOfStream for non empty stream', function () {
    (0, _vitest.expect)(_index["default"].ofString('1').endOfStream(0)).toBe(false);
  });
  (0, _vitest.it)('get from stream', function () {
    (0, _vitest.expect)(_index["default"].ofString('1').get(0).isSuccess()).toBe(true);
  });
  (0, _vitest.it)('do not get from empty stream', function () {
    (0, _vitest.expect)(_index["default"].ofString('1').get(1).isSuccess()).toBe(false);
  });
  (0, _vitest.it)('do not get from erroneous stream', function () {
    (0, _vitest.expect)(_index["default"].ofString({
      length: 1,
      charAt: function charAt() {
        throw new Error();
      }
    }).get(0).isSuccess()).toBe(false);
  });
});
//# sourceMappingURL=stream_test.spec.js.map