"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _index = require("../../lib/parsec/index");
var _default = exports["default"] = {
  setUp: function setUp(done) {
    done();
  },
  'expect p.first() to work': function expect_pFirst_to_work(test) {
    var text = 'abc';
    var parser = _index.C.letter().rep().first();
    test.equal('a', parser.val(text));
    test.done();
  },
  'expect p.last() to work': function expect_pLast_to_work(test) {
    var text = 'abc';
    var parser = _index.C.letter().rep().last();
    test.equal('c', parser.val(text));
    test.done();
  },
  'expect p.at() to work': function expect_pAt_to_work(test) {
    var text = 'abc';
    var parser = _index.C.letter().rep().map(function (t) {
      return t.at(2);
    });
    test.equal('c', parser.val(text));
    test.done();
  },
  'expect p.array to fail if not a tupleParser': function expect_pArray_to_fail_if_not_a_tupleParser(test) {
    var text = 'abc';
    var parser = _index.C.letters().array();
    var found = false;
    try {
      parser.val(text);
    } catch (_unused) {
      found = true;
    }
    test.ok(found);
    test.done();
  }
};
//# sourceMappingURL=tuple-parser-test.js.map