"use strict";

var _vitest = require("vitest");
var _index = require("../../lib/parsec/index");
(0, _vitest.describe)('Tuple Parser Tests', function () {
  (0, _vitest.it)('expect p.first() to work', function () {
    var text = 'abc';
    var parser = _index.C.letter().rep().first();
    (0, _vitest.expect)(parser.val(text)).toBe('a');
  });
  (0, _vitest.it)('expect p.last() to work', function () {
    var text = 'abc';
    var parser = _index.C.letter().rep().last();
    (0, _vitest.expect)(parser.val(text)).toBe('c');
  });
  (0, _vitest.it)('expect p.at() to work', function () {
    var text = 'abc';
    var parser = _index.C.letter().rep().map(function (t) {
      return t.at(2);
    });
    (0, _vitest.expect)(parser.val(text)).toBe('c');
  });
  (0, _vitest.it)('expect p.array to fail if not a tupleParser', function () {
    var text = 'abc';
    var parser = _index.C.letters().array();
    (0, _vitest.expect)(function () {
      return parser.val(text);
    }).toThrow();
  });
});
//# sourceMappingURL=tuple-parser-test.spec.js.map